不知道是不是安装salt后升级python-urllib3导致pip无法使用
卸载后重新源码安装
源码安装:
1 |
wget --no-check-certificate https://github.com/pypa/pip/archive/9.0.1.tar.gz |
注意:wget获取https的时候需要加上:--no-check-certificate
下载下来以后,解压安装
1 2 3 |
tar zvxf 9.0.1.tar.gz cd pip-9.0.1/ python setup.py install |
2.指定内地源安装
以上安装后还是报错 使用豆瓣源安装成功
pip install docker-compose -i https://pypi.douban.com/simple
参考http://blog.vimiix.com/2017/08/27/Linux-pip-setup-and-solve-problems.html
https://www.jianshu.com/p/3ff34df37fce
报错内容:
各种报错:
[root@centos7-template pip-9.0.1]# pip install docker-compose
Collecting docker-compose
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff1834f3890>: Failed to establish a new connection: [Errno -2] \xe6\x9c\xaa\xe7\x9f\xa5\xe7\x9a\x84\xe5\x90\x8d\xe7\xa7\xb0\xe6\x88\x96\xe6\x9c\x8d\xe5\x8a\xa1',)': /simple/docker-compose/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff1834f3dd0>: Failed to establish a new connection: [Errno -2] \xe6\x9c\xaa\xe7\x9f\xa5\xe7\x9a\x84\xe5\x90\x8d\xe7\xa7\xb0\xe6\x88\x96\xe6\x9c\x8d\xe5\x8a\xa1',)': /simple/docker-compose/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff1835f0050>: Failed to establish a new connection: [Errno -2] \xe6\x9c\xaa\xe7\x9f\xa5\xe7\x9a\x84\xe5\x90\x8d\xe7\xa7\xb0\xe6\x88\x96\xe6\x9c\x8d\xe5\x8a\xa1',)': /simple/docker-compose/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff1835f0d90>: Failed to establish a new connection: [Errno -2] \xe6\x9c\xaa\xe7\x9f\xa5\xe7\x9a\x84\xe5\x90\x8d\xe7\xa7\xb0\xe6\x88\x96\xe6\x9c\x8d\xe5\x8a\xa1',)': /simple/docker-compose/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff1835f0f10>: Failed to establish a new connection: [Errno -2] \xe6\x9c\xaa\xe7\x9f\xa5\xe7\x9a\x84\xe5\x90\x8d\xe7\xa7\xb0\xe6\x88\x96\xe6\x9c\x8d\xe5\x8a\xa1',)': /simple/docker-compose/
Could not find a version that satisfies the requirement docker-compose (from versions: )
No matching distribution found for docker-compose
[root@centos7-template pip-9.0.1]#
[root@centos7-template pip-9.0.1]# pip install --upgrade pip
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f0bcd427250>: Failed to establish a new connection: [Errno -2] \xe6\x9c\xaa\xe7\x9f\xa5\xe7\x9a\x84\xe5\x90\x8d\xe7\xa7\xb0\xe6\x88\x96\xe6\x9c\x8d\xe5\x8a\xa1',)': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f0bcd4275d0>: Failed to establish a new connection: [Errno -2] \xe6\x9c\xaa\xe7\x9f\xa5\xe7\x9a\x84\xe5\x90\x8d\xe7\xa7\xb0\xe6\x88\x96\xe6\x9c\x8d\xe5\x8a\xa1',)': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f0bcd596910>: Failed to establish a new connection: [Errno -2] \xe6\x9c\xaa\xe7\x9f\xa5\xe7\x9a\x84\xe5\x90\x8d\xe7\xa7\xb0\xe6\x88\x96\xe6\x9c\x8d\xe5\x8a\xa1',)': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f0bcd596bd0>: Failed to establish a new connection: [Errno -2] \xe6\x9c\xaa\xe7\x9f\xa5\xe7\x9a\x84\xe5\x90\x8d\xe7\xa7\xb0\xe6\x88\x96\xe6\x9c\x8d\xe5\x8a\xa1',)': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f0bcd5961d0>: Failed to establish a new connection: [Errno -2] \xe6\x9c\xaa\xe7\x9f\xa5\xe7\x9a\x84\xe5\x90\x8d\xe7\xa7\xb0\xe6\x88\x96\xe6\x9c\x8d\xe5\x8a\xa1',)': /simple/pip/
Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg
[root@centos7-template pip-9.0.1]# pip install docker^C
[root@centos7-template pip-9.0.1]# pip install docker-compose -i http://pypi.douban.com/simple
Collecting docker-compose
The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host pypi.douban.com'.
Could not find a version that satisfies the requirement docker-compose (from versions: )
No matching distribution found for docker-compose
[root@centos7-template pip-9.0.1]# pip install docker-compose -i https://pypi.douban.com/simple