gpt4 book ai didi

python - 如何删除 Conda 中的 channel ?

转载 作者:行者123 更新时间:2023-12-02 03:08:21 27 4
gpt4 key购买 nike

如何删除 channel ,或者至少指示 Conda 在 channel URL 之一出现故障时不中止?

我正在测试一个有问题的工具,它在 https://www.idiap.ch/software/bob/conda/linux-64 提供了一个 Conda repo 协议(protocol),但现在该 repo 协议(protocol)已离线,现在所有对 conda create --prefix=./cenv -y python=3.7 的调用都失败并显示消息:

Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 503 SERVICE UNAVAILABLE for url <https://www.idiap.ch/software/bob/conda/linux-64/current_repodata.json>
Elapsed: 00:02.470723

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.

我没有在我的创建命令中使用这个 channel ,所以我不知道为什么 Conda 会失败而不是忽略它。我如何允许 Conda 继续或清除 channel ?

我尝试通过运行删除 channel :

conda config --remove channels https://www.idiap.ch/software/bob/conda

输出错误:

CondaKeyError: 'channels': 'https://www.idiap.ch/software/bob/conda' is not in the 'channels' key of the config file

编辑:我的 conda 信息 是:

     active environment : None
shell level : 0
user config file : /home/myuser/.condarc
populated config files : /home/myuser/miniconda3/.condarc
/home/myuser/.condarc
conda version : 4.7.12
conda-build version : not installed
python version : 3.7.3.final.0
virtual packages :
base environment : /home/myuser/miniconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
https://www.idiap.ch/software/bob/conda/linux-64
https://www.idiap.ch/software/bob/conda/noarch
package cache : /home/myuser/miniconda3/pkgs
/home/myuser/.conda/pkgs
envs directories : /home/myuser/miniconda3/envs
/home/myuser/.conda/envs
platform : linux-64
user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.3 Linux/4.15.0-64-generic ubuntu/18.04.3 glibc/2.27
UID:GID : 1000:1000
netrc file : None
offline mode : False

运行:

conda config --remove channels https://www.idiap.ch/software/bob/conda/linux-64
conda config --remove channels https://www.idiap.ch/software/bob/conda/noarch

输出错误:

CondaKeyError: 'channels': 'https://www.idiap.ch/software/bob/conda/<name>' is not in the 'channels' key of the config file

这些是我的 .condarc 的内容:

$ cat ~/.condarc 
show_channel_urls: true
auto_activate_base: false
channels:
- defaults

最佳答案

conda config --remove channels https://www.idiap.ch/software/bob/conda

在我的测试中有效。

另一种方法是打开$HOME目录下的.condarc文件,然后注释掉相应的 channel 行。

关于python - 如何删除 Conda 中的 channel ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58368839/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com