Python pip报错:Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/pipenv

前天用pip安装包的时候,突然报了如下错误:

Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/pipenv/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.tuna.tsinghua.edu.cn’, port=443): Max retries exceeded with url: /simple/pipenv/

之前一直是没有问题的,网上给了好多解决方案,但都解决不了我的问题。

我的解决方案:把Anaconda目录下的Library//bin添加到环境变量Path中。

解释:前几天做课程实验,我把我本地Python的环境变量都删掉了,后面重新配置的时候没有把Library//bin添加进去。而Library//bin目录下有openssl,pip安装时需要用到这个openssl,找不到路径,就出错了。添加到环境变量后,错误消失。

不过我在写这篇博客之前将环境变量再一次删掉,想验证我的判断,删掉之后pip是没有问题的,正常执行。所以可能我的解释不是完全正确,但我确实是用该方法解决了错误…

猜你喜欢

转载自blog.csdn.net/weixin_43915798/article/details/107808193
今日推荐