Skip to content

Commit 8f1c25f

Browse files
committed
allow installing/using p4a in a virtualenv
1 parent 2d98daa commit 8f1c25f

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

pythonforandroid/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,8 @@ def run_pymodules_install(ctx, modules):
635635
# This bash method is what old-p4a used
636636
# It works but should be replaced with something better
637637
shprint(sh.bash, '-c', (
638-
"source venv/bin/activate && env CC=/bin/false CXX=/bin/false "
639-
"PYTHONPATH={0} pip install --target '{0}' --no-deps -r requirements.txt"
638+
"env CC=/bin/false CXX=/bin/false "
639+
"PYTHONPATH={0} venv/bin/pip install --target '{0}' --no-deps -r requirements.txt"
640640
).format(ctx.get_site_packages_dir()))
641641

642642

pythonforandroid/toolchain.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,6 @@ def build_dist_from_args(ctx, dist, args):
167167
ctx.recipe_build_order = build_order
168168
ctx.python_modules = python_modules
169169

170-
if python_modules and hasattr(sys, 'real_prefix'):
171-
error('virtualenv is needed to install pure-Python modules, but')
172-
error('virtualenv does not support nesting, and you are running')
173-
error('python-for-android in one. Please run p4a outside of a')
174-
error('virtualenv instead.')
175-
exit(1)
176-
177170
info('The selected bootstrap is {}'.format(bs.name))
178171
info_main('# Creating dist with {} bootstrap'.format(bs.name))
179172
bs.distribution = dist

0 commit comments

Comments
 (0)