venvlib: select the active python interp directly

We've been assuming the python version can be found under /usr/bin/.
This doesn't work when we're run via depot_tools python3 that is not
installed in /usr/bin/ at all, and a newer version that whatever is
there.  Use sys.executable instead to get the full path to the active
Python interpreter.

TEST=CQ passes
TEST=running on release configs works

Change-Id: I55e3efebb6daaa0b118d2b3af3f1e2dfc599652b
Reviewed-by: Chris McDonald <>
Commit-Queue: Mike Frysinger <>
Tested-by: Mike Frysinger <>
diff --git a/venv/cros_venv/ b/venv/cros_venv/
index a8034c3..ec3a8d6 100644
--- a/venv/cros_venv/
+++ b/venv/cros_venv/
@@ -27,8 +27,6 @@
 from cros_venv import flock
 _PACKAGE_DIR = os.path.join(constants.REPO_DIR, 'pip_packages')
-_VENV_PY = ('/usr/bin/python%s.%s' %
-            (sys.version_info.major, sys.version_info.minor))
 _VIRTUALENV_COMMAND = 'virtualenv'
 # BASE_DEPENDENCIES are pip requirements automatically included in every
@@ -235,7 +233,7 @@
     # by default.  virtualenv >1.10 accepts the --setuptools option but
     # does not document it.  Once we no longer have any hosts on
     # virtualenv 1.7, the --setuptools option can be removed.
-    command = [_VIRTUALENV_COMMAND, venvdir, '-p', _VENV_PY,
+    command = [_VIRTUALENV_COMMAND, venvdir, '-p', sys.executable,
                '--extra-search-dir', _PACKAGE_DIR, '--setuptools',