Virtualenv: New Virtualenv installing beta pip3 (10.0.0b2)

Created on 3 Apr 2018  ·  5Comments  ·  Source: pypa/virtualenv

I'm running Python 3.5.2 (/usr/bin/python3.5), with Pip3 8.1.1 (/usr/bin/pip3) on Ubuntu 16.04 with python3-virtualenv installed via apt. Under dpkg, the version is python3-virtualenv/xenial-updates 15.0.1+ds-3ubuntu1 all.

When I create a new environment by running the following command:

virtualenv --python=/usr/bin/python3.5 env

I am expecting the pip3 version to be 8.1.1 (the only pip3 that's installed on my system). Instead I activate the virtual env and pip --version outputs the following:

pip 10.0.0b2 from /home/ubuntu/env/lib/python3.5/site-packages/pip (python 3.5)

As an interim solution I am able to downgrade immediately after creating the environment, however this seems like it shouldn't be the intended behavior. Please let me know if or what additional information would be helpful.

Most helpful comment

@jwarren116 I believe virtualenv fetches the latest available versions of setuptools, pip, and wheel from PyPI when it creates a new virtualenv (using a local pip cache if available). And until virtualenv 15.1.0, it internally set "PIP_PRE=1" when doing that. So upgrading to virtualenv 15.1.0 or above will at least get you pip 9.0.3 installed in new virtualenvs instead. If you specifically want pip 8.1.1 in your virtualenv, I think you'll need to explicitly downgrade it after creation.

All 5 comments

Do you have a PIP_PRE environment variable, or a pip configuration file that specifies the --pre argument? Or has your distribution patched pip to install prerelease versions (unlikely, I'd have thought). Can you reproduce this behaviour with the virtualenv from PyPI (or github)?

Sorry, I meant to include that as well! I have no PIP* vars set in the environment, and there's no pip config file. I don't believe the dist has been patched, but I haven't been able to verify.

I will try to reproduce with virtualenv from PyPI or Github and circle back.

@jwarren116 I believe virtualenv fetches the latest available versions of setuptools, pip, and wheel from PyPI when it creates a new virtualenv (using a local pip cache if available). And until virtualenv 15.1.0, it internally set "PIP_PRE=1" when doing that. So upgrading to virtualenv 15.1.0 or above will at least get you pip 9.0.3 installed in new virtualenvs instead. If you specifically want pip 8.1.1 in your virtualenv, I think you'll need to explicitly downgrade it after creation.

@jmbowman Thanks for that clarification. I knew I recalled that virtualenv set PIP_PRE, but couldn't find it in a dive through the sources. It didn't occur to me to go back in history.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings