在Linux中,使用Miniconda创建 Python 3.6 环境时报以下错误
[evil@hadoop102 ~]$ conda create --name superset python=3.6
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/current_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/linux-64/current_repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'tls_process_server_certificate\', \'certificate verify failed\')])")))'))
解决:进入当前用户目录下,修改.condarc文件
注:若是root用户,修改/root/.condarc;若是其他用户,修改/home/用户/.condarc
-
查看.condarc原文
(这里之前添加了清华镜像、设置不自启base环境,所以有可能和你不一样)auto_activate_base: false show_channel_urls: true channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free - defaults
-
修改.condarc
将下面内容将原文覆盖即可auto_activate_base: false show_channel_urls: true channels: - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
实际上,将https换成了http;删除- - defaults