Eryk Sun <eryk...@gmail.com> added the comment:

This issue is partly due to bpo-8901, which changed the behavior of the -E and 
-I command-line options to make them ignore the default PythonPath value in the 
registry key "Software\Python\PythonCore\X.Y\PythonPath". The change itself is 
not wrong. It's just exposing an underlying problem.

The `home` path in pyvenv.cfg is from sys._base_executable. In a launcher-based 
environment that's created from the base installation, sys._base_executable is 
the real base executable. OTOH, in a symlink-based virtual environment, 
sys._base_executable is the same as sys.executable. Consequently, if a virtual 
environment is created from a symlink-based virtual environment, the `home` 
path in pyvenv.cfg refers to the creating environment instead of the base 
installation. In this case, with the current implementation, the standard 
library can only be found by falling back on the default PythonPath in the 
registry.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42013>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to