ubuntu18.04 anaconda 用conda创建python虚拟环境,总是提示Collecting package metadata (repodata.json): failed

ubuntu18.04 anaconda 用conda创建python虚拟环境,

conda create -n your-env-name python==2.7

总是提示Collecting package metadata (repodata.json): failed, CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://repo.anaconda.com/pkgs/main/linux-64/repodata.json
Elapsed: -

解决办法:
修改~/.condarc文件,将源换为清华源(如果没有就新建)

vim ~/.condarc
# ~/.condarc修改为下面内容,一定不保留- default
auto_activate_base: false
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/linux-64/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro/linux-64/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/linux-64/
show_channel_urls: true
ssl_verify: false

然后重新执行下面命令

conda clean -i
conda create -n your-env-name python==2.7

你可能感兴趣的:(ubuntu18.04 anaconda 用conda创建python虚拟环境,总是提示Collecting package metadata (repodata.json): failed)