【问题标题】:Upgrade pip without upgrading python on centos 6.2在centos 6.2上升级pip而不升级python
【发布时间】:2019-01-30 03:27:40
【问题描述】:

我有一个运行 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 版本是:

pip --version 1.0.2

有什么建议吗?谢谢!


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

基于这个答案为了更新请求,我需要更新 pip。

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


pip install --upgrade pip

为请求提供与上述相同的错误。

【问题讨论】:

  • 你的命令实际上是在安装一个名为requests的库,你能确认是更新pip还是requests?

标签: python pip python-requests centos6


【解决方案1】:

必须手动完成:

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

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

然后使用: pip install 安装。

我对 chardet 有额外的要求>=3.0.2,=2.5,=1.21.1,

终于成功了!

【讨论】:

    【解决方案2】:

    试试这个命令来升级 pip:

    pip install --upgrade pip
    

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

    pip install requests --upgrade
    

    【讨论】:

      【解决方案3】:

      从the official site 下载get-pip.py 并运行此代码:

      $ python get-pip.py
      

      【讨论】:

        猜你喜欢
        • 2019-03-20
        • 2017-03-30
        • 2011-02-21
        • 2013-06-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多