[issue46056] Cannot use virtual environment on Windows 10 in corporate security settings

Steve Dower report at bugs.python.org
Mon Dec 13 17:31:08 EST 2021


Steve Dower <steve.dower at python.org> added the comment:

If you execute "python -m venv --without-pip ..." to create, then as a workaround you can set the __PYVENV_LAUNCHER__ environment variable to the full path to the venv's python.exe and run the normal python3.10.exe.

As Eryk mentioned, you'll need to run everything through "-m" instead of the script wrappers that pip would install. This includes "-m ensurepip", which should be able to install pip into the venv normally.

Note that this is an undocumented/unsupported environment variable, and so it may change in later releases. But it should work fine throughout 3.10's lifetime (and it hasn't changed _yet_ in 3.11).

----------

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


More information about the Python-bugs-list mailing list