Tzu-ping Chung <[email protected]> added the comment:
Unfortunately it is not a viable solution. If you run the virtualenv python
without activation, e.g.
virtualenv --python=python3.7 foo
foo/bin/python -m venv bar
The VIRTUAL_ENV environment variable wouldn’t be set in this situation, but the
created venv (bar) would still be broken.
The only viable cue I find to detect virtualenv existence is it sets
sys.real_prefix to point to the prefix of the actual Python isntallation (i.e.
the value of sys.prefix without virtualenv), while this variable does not exist
by default. This is, however, obviously very hacky and unreliable, and not
something venv should do IMO. virtualenv is the problem here, and should be
responsible for fixing this situation instead.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue30811>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com