我正在尝试重新安装 PIP,因为我在使用代理时遇到了问题(例如这里)尝试使用https://bootstrap.pypa.io/get-pip.py
方法我收到以下错误:
sudo apt-get remove python-pip python3-pip
(好的
wget https://bootstrap.pypa.io/get-pip.py
好的)
sudo python get-pip.py
产生错误:
The directory '/home/tbrugz/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/tbrugz/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pip
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', BadStatusLine("''",))': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', BadStatusLine("''",))': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', BadStatusLine("''",))': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', BadStatusLine("''",))': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', BadStatusLine("''",))': /simple/pip/
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip
如果我删除sudo
或添加--proxy
参数,错误是一样的。欢迎使用其他安装方法 ;)
更新:忘了说我使用本地 CNTLM 代理连接到外部代理。看起来有些人遇到了类似的问题:
https://stackoverflow.com/questions/18975187/cant-use-cntlm-to-connect-to-pip