在centos 6.2上升级pip而不升级python

时间:2018-08-23 17:13:04

标签: python pip python-requests centos6

我有一个运行centos 6.2的服务器和一个在其上运行的python(2.6.66)应用程序。我无法升级os和python。我想将系统上的请求升级到2.19.1。当我尝试运行命令时,它给了我一个错误:

pip install requests==2.19.1
Downloading/unpacking requests==2.19.1
Cannot fetch index base URL http://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement requests==2.19.1
No distributions at all found for requests==2.19.1
Storing complete log in /root/.pip/pip.log

我当前的点子版本是:

pip --version 1.0.2

有什么建议吗?谢谢!


https://stackoverflow.com/a/40019222/9335996

基于此答案为了更新请求,我需要更新点子。

,但是找到了一种无需升级点数的方法。手动安装请求。


pip install --upgrade pip

给出与上述请求相同的错误。

2 个答案:

答案 0 :(得分:1)

必须手动执行:

在服务器上下载: https://github.com/requests/requests

使用:curl -OL https://github.com/requests/requests/tarball/master

然后使用以下命令进行安装:pip install。

我对chardet有其他要求> = 3.0.2,<3.1.0; idna> = 2.5,<2.8; urllib3> = 1.21.1,<1.24,我必须手动安装。

终于成功了!

答案 1 :(得分:0)

尝试使用此命令升级点子:

pip install --upgrade pip

如果要升级请求(2.19.1)是最新版本,请这样做

pip install requests --upgrade