【conda install】网络慢导致报错CondaHTTPError: HTTP 000 CONNECTION FAILED for url

⭐⭐问题:

部署安装环境经常会出现由于网络慢问题,导致conda安装不了库,报错如下:

bash 复制代码
Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/linux-64/repodata.json>
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/r/linux-64/repodata.json (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available.",))',),)

🙋🙋解决方案:

1、备份本地配置

#1、备份本地配置 
cp ~/.condarc ~/.condarc.bak

vim ~/.condarc

2.修改.condarc内容

#2、删除原来的内容,填入以下
channels:
  - defaults
show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud



#3、清除缓存
conda clean -i

保存,即可用国内镜像快速下载安装了。

整理不易,欢迎一键三连!!!

送你们一条美丽的--分割线--

🌷🌷🍀🍀🌾🌾🍓🍓🍂🍂🙋🙋🐸🐸🙋🙋💖💖🍌🍌🔔🔔🍉🍉🍭🍭🍋🍋🍇🍇🏆🏆📸📸⛵⛵⭐⭐🍎🍎👍👍🌷🌷

相关推荐
sp_wxf14 分钟前
Lambda表达式
开发语言·python
鄃鳕21 分钟前
HTTP【网络】
网络·网络协议·http
蜡笔小新星34 分钟前
Python Kivy库学习路线
开发语言·网络·经验分享·python·学习
篝火悟者1 小时前
问题-python-运行报错-SyntaxError: Non-UTF-8 code starting with ‘\xd5‘ in file 汉字编码问题
开发语言·python
hakesashou1 小时前
python如何比较字符串
linux·开发语言·python
_.Switch2 小时前
Python机器学习模型的部署与维护:版本管理、监控与更新策略
开发语言·人工智能·python·算法·机器学习
读心悦2 小时前
如何在 Axios 中封装事件中心EventEmitter
javascript·http
Hoper.J2 小时前
PyTorch 模型保存与加载的三种常用方式
人工智能·pytorch·python
弱冠少年3 小时前
websockets库使用(基于Python)
开发语言·python·numpy
CXDNW3 小时前
【网络篇】计算机网络——应用层详述(笔记)
服务器·笔记·计算机网络·http·web·cdn·dns