无法升级 Requests lib Python

无法升级 Requests lib Python

我正在尝试在 Ubuntu 14.04 上升级 Python 2.7.6 的 Requests lib,但是无法成功。

如果我尝试运行sudo pip install requests --upgrade我会收到此消息:

Downloading/unpacking requests from https://pypi.python.org/packages/49/df/50aa1999ab9bde74656c2919e
  Downloading requests-2.18.4-py2.py3-none-any.whl (88kB): 88kB downloaded
Requirement already up-to-date: certifi>=2017.4.17 in /usr/local/lib/python2.7/dist-packages (from )
Requirement already up-to-date: idna>=2.5,<2.7 in /usr/local/lib/python2.7/dist-packages (from requ)
Requirement already up-to-date: chardet>=3.0.2,<3.1.0 in /usr/local/lib/python2.7/dist-packages (fr)
Requirement already up-to-date: urllib3>=1.21.1,<1.23 in /usr/local/lib/python2.7/dist-packages (fr)
Installing collected packages: requests
   Found existing installation: requests 2.2.1
   Not uninstalling requests at /usr/lib/python2.7/dist-packages, owned by OS
Successfully installed requests
Cleaning up...

如果我尝试卸载它然后再次安装它sudo pip uninstall requests::

Not uninstalling requests at /usr/lib/python2.7/dist-packages, owned by OS.  

答案1

首先尝试一下

sudo -i pip install --upgrade requests

如果这不起作用,那么下面一个

卸载你的 pip 并安装最新的,希望这可以解决问题

卸载 -sudo pip uninstall pip

重新安装 sudo apt install python-pip

相关内容