Issue 36080: Ensurepip fails to install pip into a nested virtual environment (on Windows) (original) (raw)

Issue36080

Created on 2019-02-22 15:19 by Sammy Gillespie, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg336322 - (view) Author: Sammy Gillespie (Sammy Gillespie) Date: 2019-02-22 15:19
Running Windows 10 Enterprise. Create a virtual environment: > python -m venv .venv Activate that virtual environment and attempt to create another virtual environment using the same command. This new environment will not contain pip (or anything other than just Python). Investigating this further. Running: > python -Im ensurepip --upgrade --default-pip from within the second virtual environment results in: > Requirement already up-to-date: pip in <path_to_FIRST_venv> ---------- I want to create a python tool that will build a virtual env, but this restricts me from being able to install that tool into a virtual env (e.g. using pipx).
msg336323 - (view) Author: Sammy Gillespie (Sammy Gillespie) Date: 2019-02-22 15:35
To expand on this. Using: > python -m pip in the second virtual environment (which does not have pip) gives the following usage example: > Usage: > C:\venv_test\<VENV_1>\Scripts\python.exe -m pip [options] Yet the python running this command is not in venv_1, it is in venv_2. So the issue appears to lie with how pip determines its python location. So this issue may be more suited there.
msg336324 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-02-22 15:38
Is this similar to ? Can you please specify the full version of Python as in 3.7.0 or later?
msg336325 - (view) Author: Sammy Gillespie (Sammy Gillespie) Date: 2019-02-22 15:42
This is identical to https://bugs.python.org/issue35872 I am running 3.7.2
History
Date User Action Args
2022-04-11 14:59:11 admin set github: 80261
2019-02-24 10:39:07 eryksun set superseder: Creating venv from venv no longer works in 3.7.2
2019-02-22 16:37:49 Sammy Gillespie set status: open -> closedresolution: duplicatestage: resolved
2019-02-22 15:42:12 Sammy Gillespie set messages: +
2019-02-22 15:38:34 xtreak set nosy: + paul.moore, tim.golden, xtreak, zach.ware, steve.dowermessages: + components: + Windows
2019-02-22 15:35:41 Sammy Gillespie set messages: +
2019-02-22 15:19:41 Sammy Gillespie create