请勿走弯路。快速判断
1、PIP10以后的版本早就修复该问题,如果自己的版本过低
可以通过设置pypi.org和files.pythonhosted.org作为可信赖的主机。
2、优先检查自己的网络,是否开抓包,是否设置代理
以下是我走的弯路,虽然很快发现,才恍然大悟,希望汲取教训。特别是做测试的同学,经常喜欢开代理或者是抓包工具。
如果你是测试同学,或者是有兴趣学习测试的同学,可加入QQ测试进阶3群:363550351
pip install moviepy==1.0.2
Could not fetch URL https://pypi.org/simple/moviepy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/moviepy/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))) - skipping
当报错这个第一反应,请求https确实证书,不信任。
加信任就好:pip --trusted-host pypi.python.org install moviepy
pip --trusted-host pypi.python.org install moviepy
Could not fetch URL https://pypi.org/simple/moviepy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/moviepy/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))) - skipping
ERROR: Could not find a version that satisfies the requirement moviepy (from versions: none)
ERROR: No matching distribution found for moviepy
接着信任 pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org moviepy
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org moviepy
ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/71/64/e7f0876716d5c35612bf8e9e49299d0f491285f10f36cbb481556ab0062b/moviepy-1.0.2.tar.gz (Caused by ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)"))
这个时候应该醒悟,如果是证书错误,这个域名下的,早就不能安装了,由于刚刚新笔记本不应该有类似问题。
排查网络发现自己开了代理。