!
也想出现在这里? 联系我们
广告位
当前位置:首页>教程分享>服务器教程>清华源连接失败原因与解决 CondaHTTPError SSLError

清华源连接失败原因与解决 CondaHTTPError SSLError

在我设置好国内源之后,用conda创建虚拟环境,下载python版本时出现以下错误。

Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url 
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
SSLError(MaxRetryError(‘HTTPSConnectionPool(host=‘mirrors.tuna.tsinghua.edu.cn’, port=443): Max retries exceeded with url: /anaconda/pkgs/free/noarch/repodata.json (Caused by SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘ssl3_get_server_certificate’, ‘certificate verify failed’)],)”,),))’,),)

我的~/.condarc内容(即conda channels设置)如下

channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64
show_channel_urls: true

解决方案

在我查阅了多篇博客,尝试了多种方案之后,终于找到两种解决方案:

  • 在命令行中输入conda config --set ssl_verify false修改设置,或者在文件~/.condarc末尾添加一行ssl_verify: false(有则修改即可)
  • 将https改成http

两种方法选一种即可

原因分析

https协议比http协议多了SSL,TLS等验证和加密的阶段,可能是在与清华源进行SSL验证的过程中会出问题,因此需要关掉SSL验证,或者改用http协议。但是使用SSL验证是有助于保障传输过程的可靠性的。

给TA打赏
共{{data.count}}人
人已打赏
服务器教程

Windows 2008 R2 如何解决无法设置弱密码

2021-4-17 18:52:52

服务器教程

ip address与ifconfig以及网卡配置文件的总结

2021-4-17 18:53:24

声明 本站上的部份代码及教程来源于互联网,仅供网友学习交流,若您喜欢本文可附上原文链接随意转载。无意侵害您的权益,请发送邮件至 [email protected] 或点击右侧 私信:吉吉国王 反馈,我们将尽快处理。
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索
OneEase