求问ubuntu下安装conda显示成功,输入命令总是报
CondaHTTPError: HTTP 000 CONNECTION FAILED for url http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64/current_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.
'http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64'
这种错误通常是由于网络问题导致的。你可以尝试以下方法来解决这个问题:
1.检查网络连接是否正常,确保能够正常访问网络。
2.尝试在命令行中输入 ping mirrors.tuna.tsinghua.edu.cn,看看能否正常访问这个地址。如果不能正常访问,可能是由于网络问题导致的。
3.如果网络连接正常,但是还是出现这个错误,可以尝试使用其他镜像地址重新安装 conda。例如,可以使用 https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/ 替换默认的镜像地址。
如果还是无法解决问题,可以尝试使用命令行工具 curl 来测试网络连接是否正常。例如,可以输入命令 curl -I http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64/current_repodata.json 来检测这个地址是否能够访问。
如果以上方法都不能解决问题,可以尝试清除 conda 的缓存,再重新安装。你可以使用命令 conda clean --all 来清除缓存,然后再重新安装 conda。
希望以上建议能够帮助你解决这个问题。
可以先试试使用以下命令更新 conda 安装:
conda update conda
如果这条命令无法正常工作,可以试试使用以下命令来删除并重新安装 conda:
rm -rf /anaconda3/
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2019.07-Linux-x86_64.sh
bash Anaconda3-2019.07-Linux-x86_64.sh
如果还是无法解决问题,可以试试查看这些文章,里面可能会有更多有用的信息:
https://stackoverflow.com/questions/46656628/conda-install-httperror-http-error-404-not-found
https://github.com/conda/conda/issues/7126
仅供参考,望采纳,谢谢。
如果你在使用 conda 命令时遇到了 CondaHTTPError 错误,可能是因为 conda 无法访问 Anaconda 镜像站点,导致无法下载或安装包。
你可以尝试以下几种方法来解决这个问题:
1、检查网络连接是否正常。你可以使用命令 ping anaconda.org 测试网络连接是否正常。
2、更换 conda 镜像站点。你可以在国内使用清华大学的镜像站点,在国外使用阿里云的镜像站点,这可能会更快一些。可以使用命令 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ 更换镜像站点。
3、清除 conda 缓存。你可以使用命令 conda clean -t 来清除 conda 缓存。
4、重新安装 conda。你可以先卸载 conda,然后重新安装最新版本的 conda。可以使用命令 sudo rm -rf /usr/local/anaconda3 卸载 conda。
希望能够帮助到你!
解决方法:
检查网络连接是否正常,如果不正常请尝试重启网络或者更换网络。
尝试使用代理连接,可以在命令行中使用以下命令设置代理:
export https_proxy=http://your-proxy-server:port
export http_proxy=http://your-proxy-server:port
尝试使用国内的镜像源,可以使用以下命令修改镜像源:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
尝试更新conda版本,可以使用以下命令更新conda版本:
conda update conda
如果以上方法都无法解决问题,可以尝试在命令行中使用以下命令清除缓存并重新安装conda:
conda clean --all
conda install conda
An HTTP error occurred when trying to retrieve this URL.
尝试检索此URL时发生HTTP错误。
解题思路:
将添加的清华源地址中的https改为http,添加清华源如下:
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 --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes