Repository: incubator-beam
Updated Branches:
  refs/heads/python-sdk 29b55e956 -> 2f09003e3


Use sys.executable and "-m pip" to ensure we use the same Python and pip as the 
currently running one.


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/7de9830d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/7de9830d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/7de9830d

Branch: refs/heads/python-sdk
Commit: 7de9830d96c7928444a5a4849698e70ec423ef62
Parents: 29b55e9
Author: Christian Hudon <chr...@pianocktail.org>
Authored: Thu Sep 15 15:10:57 2016 -0400
Committer: Robert Bradshaw <rober...@google.com>
Committed: Mon Sep 19 17:50:57 2016 -0700

----------------------------------------------------------------------
 sdks/python/apache_beam/utils/dependency.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/7de9830d/sdks/python/apache_beam/utils/dependency.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/utils/dependency.py 
b/sdks/python/apache_beam/utils/dependency.py
index 56700f5..e9d73ae 100644
--- a/sdks/python/apache_beam/utils/dependency.py
+++ b/sdks/python/apache_beam/utils/dependency.py
@@ -57,6 +57,7 @@ import logging
 import os
 import re
 import shutil
+import sys
 import tempfile
 
 
@@ -194,7 +195,7 @@ def _populate_requirements_cache(requirements_file, 
cache_dir):
   # It will get the packages downloaded in the order they are presented in
   # the requirements file and will not download package dependencies.
   cmd_args = [
-      'pip', 'install', '--download', cache_dir,
+      sys.executable, '-m', 'pip', 'install', '--download', cache_dir,
       '-r', requirements_file,
       # Download from PyPI source distributions.
       '--no-binary', ':all:']
@@ -374,7 +375,7 @@ def _build_setup_package(setup_file, temp_dir, 
build_setup_args=None):
     os.chdir(os.path.dirname(setup_file))
     if build_setup_args is None:
       build_setup_args = [
-          'python', os.path.basename(setup_file),
+          sys.executable, os.path.basename(setup_file),
           'sdist', '--dist-dir', temp_dir]
     logging.info('Executing command: %s', build_setup_args)
     processes.check_call(build_setup_args)
@@ -460,7 +461,7 @@ def _download_pypi_sdk_package(temp_dir):
   version = pkg.get_distribution(GOOGLE_PACKAGE_NAME).version
   # Get a source distribution for the SDK package from PyPI.
   cmd_args = [
-      'pip', 'install', '--download', temp_dir,
+      sys.executable, '-m', 'pip', 'install', '--download', temp_dir,
       '%s==%s' % (GOOGLE_PACKAGE_NAME, version),
       '--no-binary', ':all:', '--no-deps']
   logging.info('Executing command: %s', cmd_args)

Reply via email to