Linux下解决Anaconda出现CondaHTTPError: HTTP 000 CONNECTION FAILED for url问题

先说问题,使用清华的镜像,

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes

执行conda create -n superset python=3.7 时,报错如下错误,

 

解决方法如下:

在命令行输入:

vim ~/.condarc

#插入如下字段
auto_activate_base: false
channels:
  - defaults
show_channel_urls: true


channel_alias: http://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

再次执行conda create -n superset python=3.7

 

 创建成功!

  • 3
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Linux中,当遇到"CondaHTTPError: HTTP 000 CONNECTION FAILED for url"错误时,这通常是由于网络连接问题引起的。这可能是由于网络不稳定、代理设置不正确或者源服务器无法访问导致的。 解决问题的一种方法是更改Conda的源为其他可用的源。你可以通过编辑".condarc"文件或使用"conda config"命令来更改。在".condarc"文件中,你可以指定channels(通道)和show_channel_urls的值。你可以尝试将channels更改为其他可用源,如清华大学镜像源、中科大镜像源等。此外,你还可以尝试将show_channel_urls的值设置为false以禁用显示通道URL。 如果更改源后仍然无法解决问题,你可以尝试以下方法来提高网络连接的稳定性: 1. 检查网络连接:确保你的网络连接正常,并且没有任何防火墙或代理设置阻止了Conda的访问。 2. 使用代理:如果你处于一个需要使用代理服务器才能访问外部网络的环境中,可以通过配置Conda使用正确的代理服务器来解决问题。你可以使用"conda config"命令或编辑".condarc"文件来配置代理。 3. 检查Conda版本:确保你正在使用最新版本的Conda。你可以使用"conda update conda"命令来更新Conda。 4. 重试操作:如果网络连接不稳定,你可以多次重试操作,有时候重试几次可能会成功。 总结起来,当在Linux中遇到"CondaHTTPError: HTTP 000 CONNECTION FAILED for url"错误时,你可以尝试更改Conda的源为其他可用源,并检查网络连接、代理设置、Conda版本等因素是否正确。这些方法有助于解决问题
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值