|
30 | 30 | from pythonforandroid.archs import (ArchARM, ArchARMv7_a, Archx86)
|
31 | 31 | from pythonforandroid.logger import (logger, info, warning, setup_color,
|
32 | 32 | Out_Style, Out_Fore, Err_Style, Err_Fore,
|
33 |
| - info_notify, info_main, shprint) |
| 33 | + info_notify, info_main, shprint, error) |
34 | 34 | from pythonforandroid.util import current_directory, ensure_dir
|
35 | 35 | from pythonforandroid.bootstrap import Bootstrap
|
36 | 36 | from pythonforandroid.distribution import Distribution, pretty_log_dists
|
@@ -118,6 +118,13 @@ def build_dist_from_args(ctx, dist, args):
|
118 | 118 | ctx.recipe_build_order = build_order
|
119 | 119 | ctx.python_modules = python_modules
|
120 | 120 |
|
| 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 | + |
121 | 128 | info('The selected bootstrap is {}'.format(bs.name))
|
122 | 129 | info_main('# Creating dist with {} bootstrap'.format(bs.name))
|
123 | 130 | bs.distribution = dist
|
|
0 commit comments