8000 Merge pull request #742 from kived/venv-error · modulexcite/python-for-android@ac25fab · GitHub
[go: up one dir, main page]

Skip to content

Commit ac25fab

Browse files
committed
Merge pull request kivy#742 from kived/venv-error
throw error early if running in venv
2 parents 8220be9 + b1ae67f commit ac25fab

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pythonforandroid/toolchain.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from pythonforandroid.archs import (ArchARM, ArchARMv7_a, Archx86)
3131
from pythonforandroid.logger import (logger, info, warning, setup_color,
3232
Out_Style, Out_Fore, Err_Style, Err_Fore,
33-
info_notify, info_main, shprint)
33+
info_notify, info_main, shprint, error)
3434
from pythonforandroid.util import current_directory, ensure_dir
3535
from pythonforandroid.bootstrap import Bootstrap
3636
from pythonforandroid.distribution import Distribution, pretty_log_dists
@@ -118,6 +118,13 @@ def build_dist_from_args(ctx, dist, args):
118118
ctx.recipe_build_order = build_order
119119
ctx.python_modules = python_modules
120120

121+
if python_modules and hasattr(sys, 'real_prefix'):
122+
error('virtualenv is needed to install pure-Python modules, but')
123+
error('virtualenv does not support nesting, and you are running')
124+
error('python-for-android in one. Please run p4a outside of a')
125+
error('virtualenv instead.')
126+
exit(1)
127+
121128
info('The selected bootstrap is {}'.format(bs.name))
122129
info_main('# Creating dist with {} bootstrap'.format(bs.name))
123130
bs.distribution = dist

0 commit comments

Comments
 (0)
0