Windows利用Anaconda创建虚拟环境时报错:
Fetching package metadata …
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pk
gs/main/win-64/python-3.6.7-h9f7ef89_2.tar.bz2>
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.
问题原因:
Anaconda镜像源在国外,网络不稳定,更换国内镜像源
解决方法:
Step 1 :在命令行中输入并运行:(清华大学镜像)
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
Step 2 :更改配置文件
按上面的设置镜像源后,再打开C:\Users\Administrator.condarc这个文件,删除 -defaults这一行
Step 3 :安装
cmd:conda create -n oop python=3.6
conda env list
Step 4 :激活
cmd:activate oop
conda list