时间: 2023/11/21
发布到CSDN: No
系统: Windows
问题描述
由于本机的python3.8版本的pip错误,导致无法使用pip命令来安装库,所以使用python -m pip uninstall pip
删除了pip,然而当想再次安装pip时,出现错误
错误如下:
Looking in indexes: http://pypi.douban.com/simple WARNING: Retrying (Retry(total=4, connect=None,
read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.'
, OSError(0, 'Error'))': /pypi/simple/pip/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None,
status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))':
/pypi/simple/pip/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))':
/pypi/simple/pip/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))
after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /pypi/simple/pip/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken
by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /pypi/simple/pip/ ERROR: Could not find a version
that satisfies the requirement pip (from versions: none) ERROR: No matching distribution found for pip
原因
是由于网络问题,需要链接到国外网站
解决
在python官网上下载pip的安装包,然后本地进行安装
https://pypi.org/project/pip/#files
参考网站
Python - Pip Install - Proxy Error - ‘Cannot connect to proxy.’, OSError’
解释了为什么会出现这种情况
How to Install PIP on Windows ? - GeeksforGeeks
通常情况下的安装步骤(国外的网络环境)
最终的解决方案