virtualenv use upgraded system default pip

2019-05-14 08:22发布

How do I get my virtual environments to use my system upgraded pip?
Before creating a virtualenv, pip shows version 9.0.1, but inside the virtual environment it reverts back to 8.1.1, forcing me to upgrade all my virtualenv pips.

$ pip --version
pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ pip --version
pip 8.1.1 from /tmp/venv/lib/python3.5/site-packages (python 3.5)
(venv) $ pip install --upgrade pip
(venv) $ pip --version
pip 9.0.1 from /tmp/venv/lib/python3.5/site-packages (python 3.5)

1条回答
Melony?
2楼-- · 2019-05-14 08:27

When you create your virtualenv with the command

python3 -m venv venv

Your current Python 3 installation is used as the basis of your virtualenv.

Run the command

pip3 install --upgrade pip

outside of your virtualenv to upgrade the version of pip you have installed then create a new virtualenv.

查看更多
登录 后发表回答