文章目录
解决方法
这个问题的原因是pip源太慢,我们可以用国内的源,比如豆瓣,这里用的是豆瓣的源。
输入下面的代码可以解决:
pip install pandas -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
这个问题的模板如下:
pip install 想安装的包 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
其实,我们用pip下载的原理也就是连接到python的官方源,然后下载到本地。后者用的是国内的镜像源,加快速度。
遇到的问题
PS D:\user\文档\python\python_work\data_visualization> pip install pandas
Defaulting to user installation because normal site-packages is not writeable
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/pandas/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/pandas/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/pandas/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/pandas/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/pandas/
Could not fetch URL https://pypi.org/simple/pandas/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pandas/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))) - skipping
ERROR: Could not find a version that satisfies the requirement pandas
ERROR: No matching distribution found for pandas
参考
[1]python项目ImportError: Plotly express requires pandas to be installed.解决方案
[2]国内的pythoner强烈建议使用豆瓣的pypi源 zz