我可以更新pip管理的包,但如何更新pip本身?根据pip--version,我目前在virtualenv中安装了pip1.1,我想更新到最新版本。

这是什么命令?我需要使用distribute吗?或者是否有本机pip或virtualenv命令?我已经尝试过pip更新和pip更新,但没有成功。


当前回答

在我的例子中,这是从Debian Stable的终端命令行运行的

python3 -m pip install --upgrade pip

其他回答

我吃树莓皮也有类似的问题。

问题是http需要SSL,所以我需要强制它使用https来绕过这一要求。

sudo pip install --upgrade pip --index-url=https://pypi.python.org/simple

or

sudo pip-3.2 --upgrade pip --index-url=https://pypi.python.org/simple/

在我的情况下,我的pip版本已损坏,因此更新本身无法工作。

Fix:

(inside virtualenv):easy_install -U pip

在Windows 7的笔记本电脑上,安装最新版本的pip的正确方法是:

python.exe -m pip install --upgrade pip

首先,执行以下操作:

sudo apt install python3 pip python setuptools文档

然后,作为非root用户(绝不,绝不以root身份运行pip*!):

# N.B. bash shell works for this, I have never tested with other shells!
. ....your_virtualenv_folder/bin/activate
pip3 install -U pip

注意:据我所知,-U是--upgrade的同义词。

为了让这对我起作用,我必须使用Python命令提示符(在WIN10上,VS CODE)在Python目录中向下搜索。在我的例子中,它位于AppData\Local\Programs\Python\python35-32目录中。从那里开始,我运行命令。。。

python -m pip install --upgrade pip

这奏效了,我很乐意去。