当我们在使用 Anaconda Prompt中,我们会经常用到conda命令来进行环境的管理,和第三方包的管理。但如果出现以下问题该怎么办呢? 别慌,看完你就知道了。
报错代码:
Could not fetch URL https://pypi.python.org/simple/tensorflow/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748) - skipping
(base) C:\Users\genec>conda create --name python36 python=3.6
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/r/win-64/repodata.json.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.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/r/win-64/repodata.json.bz2 (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')])")))'))
网上有教程提示更换源安装,即可。下图是尝试更换源的结果...
(base) C:\Users\genec>conda create --name python36 python=3.6
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/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/free/win-64/repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')])")))'))
问题依旧没有得到解决。那么该怎么办呢?
其实主要是你的网络SSL认证出现了问题,你可以尝试这样做:
- 用记事本或者Notepad++打开 C:\Users\你的用户名 下的.condarc文件。
- 将 ssl_verify改成false即可。
如果想要换回conda原来的源,在Anaconda Prompt中输入:
conda config --remove-key channels