How can I get rid of this warning to upgrade from

2019-02-24 19:31发布

Whenever I use pip, it warns me that my pip is out of date and that I need to upgrade it by doing pip install --upgrade pip.

But when I do that it seemingly has no effect and simply tells me the same thing. It's circular!

How can I fix this? See below

$ pip install --upgrade pip
You are using pip version 6.0.8, however version 8.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Requirement already up-to-date: pip in my-virtualenv/lib/python2.7/site-packages

EDIT: I'm running Red Hat Enterprise Linux (on AWS). So I just tried uninstalling and reinstalling python-pip. When I did that it tells me it will install pip 6.1.1.-1.21.amzn1. How can I make it install the newer version??

4条回答
再贱就再见
2楼-- · 2019-02-24 19:57

This one was resolved here:

How to suppress pip upgrade warning?

There is a known issue with pip where it will print that warning even if you have the version of pip that shipped with your OS. It is safe to get rid of the warning with this command:

mkdir -p $HOME/.config/pip
printf "[global]\ndisable-pip-version-check = True\n" \
  > $HOME/.config/pip/pip.conf
查看更多
Animai°情兽
3楼-- · 2019-02-24 20:02

You can fix it with:

pip3 install --upgrade pip

It worked for me

查看更多
女痞
4楼-- · 2019-02-24 20:04

You need to run:

pip install --upgrade pip

twice.

The first time it upgrades to version 8.1.0 and the second time to 8.1.1. After this there will be no warnings anymore.

查看更多
姐就是有狂的资本
5楼-- · 2019-02-24 20:13

You can install pip using system package manager,

for ubuntu/debian: apt-get install python-pip

for arch: pacman -S python-pip

In this the package manager will update pip every time a new version will be available for your distribution.

查看更多
登录 后发表回答