Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip installed in virtualenv matches virtualenv installation python not python in virtualenv #1600

Closed
emonty opened this issue Feb 12, 2020 · 6 comments
Labels

Comments

@emonty
Copy link
Contributor

@emonty emonty commented Feb 12, 2020

This one's a little esoteric - but if you install virtualenv>20 with python2, then create a virtualenv with --python=python3 - the pip commands installed in the virtualenv are pip and pip2 rather than pip and pip3. Basically, the suffix is matching the python that the virtualenv is running with, not the python that the virtualenv is installing.

For example:

# pip2 install 'virtualenv==20.0.3'
# /usr/bin/virtualenv -p python3 blerg . # this is in a centos7 container, pip2 installs into /usr/bin
# ls blerg/bin/pip*
pip pip2 pip2.7
# rm -rf blerg
# pip2 install 'virtualenv<20'
# /usr/bin/virtualenv -p python3 blerg
# ls blerg/bin/pip*
pip pip3 pip3.6
@gaborbernat

This comment has been minimized.

Copy link
Contributor

@gaborbernat gaborbernat commented Feb 13, 2020

We need to convince our script maker to use the target environments version, not the host pythons version at https://github.com/pypa/virtualenv/blob/master/src/virtualenv/seed/via_app_data/pip_install/base.py#L133-L140

@asottile

This comment has been minimized.

Copy link
Contributor

@asottile asottile commented Feb 14, 2020

@gaborbernat

This comment has been minimized.

Copy link
Contributor

@gaborbernat gaborbernat commented Feb 22, 2020

@asottile what happened with the upstream issue; seems to lead to 404 🤔

gaborbernat added a commit to gaborbernat/virtualenv that referenced this issue Feb 22, 2020
Resolves pypa#1600.

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
@gaborbernat

This comment has been minimized.

Copy link
Contributor

@gaborbernat gaborbernat commented Feb 22, 2020

Anyways pushed a workaround now under #1655 until upstream allows doing this.

gaborbernat added a commit to gaborbernat/virtualenv that referenced this issue Feb 22, 2020
Resolves pypa#1600.

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
gaborbernat added a commit to gaborbernat/virtualenv that referenced this issue Feb 22, 2020
Resolves pypa#1600.

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
@gaborbernat

This comment has been minimized.

Copy link
Contributor

@gaborbernat gaborbernat commented Feb 22, 2020

Reported the feature request again upstream under the link https://bitbucket.org/pypa/distlib/issues/134/allow-specifying-the-version-information

gaborbernat added a commit to gaborbernat/virtualenv that referenced this issue Feb 22, 2020
Resolves pypa#1600.

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
gaborbernat added a commit to gaborbernat/virtualenv that referenced this issue Feb 22, 2020
Resolves pypa#1600.

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
gaborbernat added a commit that referenced this issue Feb 22, 2020
Resolves #1600.

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
@gaborbernat

This comment has been minimized.

Copy link
Contributor

@gaborbernat gaborbernat commented Feb 26, 2020

Hello, a fix for this issue has been released via virtualenv 20.0.6; see https://pypi.org/project/virtualenv/20.0.6/ (https://virtualenv.pypa.io/en/latest/changelog.html#v20-0-6-2020-02-26) . Please give a try and report back if your issue has not been addressed; if not, please comment here, and we'll reopen the ticket. We want to apologize for the inconvenience this has caused you and say thanks for having patience while we resolve the unexpected bugs with this new major release.
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.