docker conda UnavailableInvalidChannel: The channel is not accessible or is invalid As of conda 4.3

conda install numpy

Collecting package metadata: failed

UnavailableInvalidChannel: The channel is not accessible or is invalid.
  channel name: conda_channel
  channel url: file:///home/jovyan/work/pkgs/conda_channel
  error code: 404

You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state,
and use `conda config --show-sources` to view config file locations.

As of conda 4.3, a valid channel must contain a `noarch/repodata.json` and
associated `noarch/repodata.json.bz2` file, even if `noarch/repodata.json` is
empty. Use `conda index /home/jovyan/work/pkgs/conda_channel`, or create `noarch/repodata.json`
and associated `noarch/repodata.json.bz2`.

以上错误是证明conda配置源不正确

检查源是否可用,配置源的方法执行百度《conda 国内源》

# 查询本地源
conda config --show-sources

==> envvars <== 
channel:
   - /home/jovyan/work/pkgs/conda_channel

# 正常conda的源如下显示

==> /opt/conda/.condarc <==
auto_update_conda: False
channels:
  - conda-forge
  - defaults
show_channel_urls: True

# 在一个目录下存在一个.condarc文件
# env 命令查询环境变量

env

# 变量中有一下变量
CONDA_CHANNEL=/home/jovyan/work/pkgs/conda_channel

重新配置环境

export CONDA_CHANNEL="https://mirrors.ustc.edu.cn/anaconda/pkgs/main/"
# 本文是在docker中的变量,编写在Dockerfile中
ENV CONDA_CHANNEL="https://mirrors.ustc.edu.cn/anaconda/pkgs/main/"
发布了157 篇原创文章 · 获赞 85 · 访问量 34万+

猜你喜欢

转载自blog.csdn.net/Areigninhell/article/details/98483210
今日推荐