Anaconda创建环境时报错CondaHTTPError

安装好Anaconda后想要创建一个新的虚拟环境,采用如下命令:

conda create --name tensorflow python=3.7

报错信息

发现报 CondaHTTPError: HTTP 000 CONNECTION FAILED for url 错误,具体错误信息如下:

Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/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.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'mirrors.tuna.tsinghua.edu.cn\', port=443): Max retries exceeded with url: /anaconda/pkgs/main/noarch/repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')])")))'))

解决方法: 关闭SSL认证

方法1:修改配置文件.condarc

(位置在家目录下,windows下在C:\Users\你的账户名;linux下在~/下)
设置ssl_verify为false,可以规避SSL报错。

ssl_verify: false

方法2:通过命令行方式

推荐用命令行的方式关闭SSL认证:

conda config --set ssl_verify false

你可能感兴趣的:(Python,python)