'Returns:
- absolute path to either the preferred or
default system interpreter
- None if none of the above exists'

def interpreter_from_env(self, env):

    python = None
    if env.has_pref(self.interpreterPrefName):
        python = (env.get_pref(self.interpreterPrefName).strip() or None)
    if ((not python) or (not exists(python))):
        import which
        syspath = env.get_envvar('PATH', '')
        path = [d.strip() for d in syspath.split(os.pathsep) if d.strip()]
        try:
            python = which.which('python', path=path)
        except which.WhichError:
            pass
    if python:
        python = os.path.abspath(python)
    return python
