pip更新失败

centos安装pip失败

遇到的问题:在安装pip时,报错

yum -y install python-pip

报错如下

ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
You are using pip version 8.1.2, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[root@localhost ~]# pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
    7% |██▎                             | 92kB 3.9kB/s eta 0:05:12Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/site-packages/
  
  ......
  
  
   File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 242, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
You are using pip version 8.1.2, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[root@localhost ~]# 

安装get-pip.py:

[root@localhost ~]# yum install -y wget


[root@localhost ~]# wget https://bootstrap.pypa.io/get-pip.py

[root@localhost ~]# python get-pip.py 

[root@localhost ~]# pip --version

你可能感兴趣的:(pip更新失败)