有时候配置了国内加速站,但conda create命令还是失败。可能是conda配置中开启了tls验证,而服务器不支持证书验证。
创建环境报错
conda create -n xxx python==3.10
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 504 GATEWAY TIME-OUT for url <http://10.155.97.225:8088/repository/conda-proxy/main/linux-64/current_repodata.json>
Elapsed: 00:06.135958
A remote server error occurred when trying to retrieve this URL.
A 500-type error (e.g. 500, 501, 502, 503, etc.) indicates the server failed to
fulfill a valid request. The problem may be spurious, and will resolve itself if you
try your request again. If the problem persists, consider notifying the maintainer
of the remote server.
执行命令,发现配置如下:
conda config --show-sources
==> /root/.condarc <==
channel_alias: http://10.155.97.225:8088/repository/conda-proxy
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
default_channels:
- main
- r
show_channel_urls: True
编辑文件/etc/conda,做如下操作:
- 删除里面的channel_alias
- 原本是
ssl_verify: true,要设置ssl_verify: false
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
ssl_verify: false
文章讲述了在配置了国内镜像加速后,使用conda创建环境仍遇到失败的问题,可能原因是conda配置中启用了TLS验证,而服务器不支持证书验证。解决方法包括检查并修改conda配置文件,特别是`ssl_verify`选项,将其设置为`false`来禁用TLS验证,并调整channel顺序,确保使用的是有效的镜像源。
1万+

被折叠的 条评论
为什么被折叠?



