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

Vinay Sajip report at bugs.python.org
Wed Nov 22 02:22:44 EST 2017


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

> I don't understand why things would be different when nesting?

Specifically because venv keeps "a pointer" to the Python environment it was created from. Usually that's a system Python. If a venv ("inner") is created from a virtualenv's interpreter, the pointer points back to that environment ("outer", in this case).

Also, virtualenv can re-invoke itself with a different interpreter easily - that's business as usual. However, the venv module is part of a specific Python stdlib and doesn't reinvoke itself with a different interpreter.

To find the exact mechanisms which lead to these behaviours, you would need to examine the code of virtualenv and the venv module and perhaps do some stepping through in a debugger!

----------

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


More information about the Python-bugs-list mailing list