[issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own.

Tzu-ping Chung report at bugs.python.org
Thu Jan 18 05:56:09 EST 2018


Tzu-ping Chung <uranusjr at gmail.com> added the comment:

Plot twist: the workaround does not work on Windows.

    $ cd SOMEDIR   ; Placeholder for a valid directory.
    $ virtualenv env1
    ...
    $ env\Scripts\python.exe
    Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sysconfig
    >>> print(sysconfig.get_config_var('BINDIR'))
    SOMDIR\env1\Scripts

This points to the virtualenv's BINDIR, not the real Python installation's :(

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30811>
_______________________________________


More information about the Python-bugs-list mailing list