[issue38369] Python 3.7.4 venv command does not install pip

Paul Moore report at bugs.python.org
Fri Oct 4 05:37:27 EDT 2019


Paul Moore <p.f.moore at gmail.com> added the comment:

This appears to be somehow caused by running Python 3.7.4 from an active virtualenv (which I'd forgotten I had active when I did the test).

Regardless, I'd have expected that the command would either correctly create a venv containing pip, or fail to create the venv at all. Creating an incomplete venv is extremely confusing for the user, if nothing else.

It looks like this is *not* a regression - it's been like this since 3.6.8 at least.

Actually, the created venv looks pretty broken to me - it has the *parent* environment in `sys.path`, but does not have its *own* environment there:

>.\ve-368a\Scripts\python.exe
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', 'C:\\Work\\Scratch\\vv\\ve-368a\\Scripts\\python36.zip', 'C:\\Users\\UK03306\\.virtualenvs\\f1980c81dac32d4\\DLLs', 'C:\\Users\\UK03306\\.virtualenvs\\f1980c81dac32d4\\lib', 'C:\\Users\\UK03306\\.virtualenvs\\f1980c81dac32d4\\Scripts', 'C:\\Utils\\PythonVersions\\Python-3.6.8\\Lib', 'C:\\Utils\\PythonVersions\\Python-3.6.8\\DLLs', 'C:\\Users\\UK03306\\.virtualenvs\\f1980c81dac32d4', 'C:\\Users\\UK03306\\.virtualenvs\\f1980c81dac32d4\\lib\\site-packages']

Note the lack of ve-368a directories, and the presence of a lot of directories from .virtualenvs (the parent environment).

----------

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


More information about the Python-bugs-list mailing list