问题:
最近使用anaconda创建环境时,总是遇到以下错误(原镜像源地址为清华源):
conda create -n code python=3.6
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch/repodata.json>
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.
ConnectionError(ReadTimeoutError("HTTPSConnectionPool(host='mirrors.tuna.tsinghua.edu.cn', port=443): Read timed out."))
解决方法:
将镜像源地址更换为上海交大的镜像源地址:
nano ~/.condarc
.condarc中的内容:
channels:
- https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/main/
- https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/free/
- https://mirrors.sjtug.sjtu.edu.cn/anaconda/cloud/conda-forge/
show_channel_urls: true
pip的镜像源地址:
# 中国科技大学
https://pypi.mirrors.ustc.edu.cn/simple/