Skip to content

Fix a problem with the way we were calling virtualenv #2145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 20 commits into from
Closed
27 changes: 17 additions & 10 deletions pythonforandroid/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,17 +764,24 @@ def run_pymodules_install(ctx, modules, project_dir=None,
project_has_setup_py(project_dir) and not ignore_setup_py:
info('Will process project install, if it fails then the '
'project may not be compatible for Android install.')

venv = sh.Command(ctx.virtualenv)
venv = sh.Command('python3')
with current_directory(join(ctx.build_dir)):
shprint(venv,
'--python=python{}'.format(
ctx.python_recipe.major_minor_version_string.
partition(".")[0]
),
'venv'
)

try:
shprint(venv,
'-m venv'.format(
ctx.python_recipe.major_minor_version_string.
partition(".")[0]
),
'venv'
)
except sh.ErrorReturnCode_1:
shprint(venv,
'-m virtualenv'.format(
ctx.python_recipe.major_minor_version_string.
partition(".")[0]
),
'venv'
)
# Prepare base environment and upgrade pip:
base_env = copy.copy(os.environ)
base_env["PYTHONPATH"] = ctx.get_site_packages_dir()
Expand Down