创建conda环境时报错

1.创建conda环境命令行及报错内容如下:

(base) guest14@user-R8424-G12:~/lcc/ELASTIC$ conda create --name ELASTIC
Channels:
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): - Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f118391c7d0>: Failed to establish a new connection: [Errno 111] Connection refused')': /anaconda/pkgs/free/noarch/repodata.json

Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1181058f10>: Failed to establish a new connection: [Errno 111] Connection refused')': /pkgs/main/linux-64/repodata.json.zst

Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1181055a10>: Failed to establish a new connection: [Errno 111] Connection refused')': /anaconda/pkgs/free/linux-64/repodata.json

Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1181044a90>: Failed to establish a new connection: [Errno 111] Connection refused')': /anaconda/pkgs/main/linux-64/repodata.json.zst

Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1181044390>: Failed to establish a new connection: [Errno 111] Connection refused')': /anaconda/pkgs/main/noarch/repodata.json.zst

Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f118105b750>: Failed to establish a new connection: [Errno 111] Connection refused')': /pkgs/r/noarch/repodata.json.zst

Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1181024f90>: Failed to establish a new connection: [Errno 111] Connection refused')': /pkgs/r/linux-64/repodata.json.zst

Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f118101e4d0>: Failed to establish a new connection: [Errno 111] Connection refused')': /pkgs/main/noarch/repodata.json.zst
                                                                                                                                                                                                                                  - Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1186ecb510>: Failed to establish a new connection: [Errno 111] Connection refused')': /anaconda/pkgs/free/noarch/repodata.json

Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1181045d50>: Failed to establish a new connection: [Errno 111] Connection refused')': /pkgs/main/linux-64/repodata.json.zst

Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1181025590>: Failed to establish a new connection: [Errno 111] Connection refused')': /anaconda/pkgs/free/linux-64/repodata.json

Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1181025fd0>: Failed to establish a new connection: [Errno 111] Connection refused')': /pkgs/r/noarch/repodata.json.zst

Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f11810258d0>: Failed to establish a new connection: [Errno 111] Connection refused')': /anaconda/pkgs/main/noarch/repodata.json.zst

Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f11810265d0>: Failed to establish a new connection: [Errno 111] Connection refused')': /pkgs/r/linux-64/repodata.json.zst

Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1181045510>: Failed to establish a new connection: [Errno 111] Connection refused')': /anaconda/pkgs/main/linux-64/repodata.json.zst

Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f118101ee10>: Failed to establish a new connection: [Errno 111] Connection refused')': /pkgs/main/noarch/repodata.json.zst
                                                                                                                                                                                                                                  - Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f118101f450>: Failed to establish a new connection: [Errno 111] Connection refused')': /anaconda/pkgs/free/noarch/repodata.json

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f118101fa10>: Failed to establish a new connection: [Errno 111] Connection refused')': /pkgs/main/linux-64/repodata.json.zst

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f118101ff10>: Failed to establish a new connection: [Errno 111] Connection refused')': /pkgs/r/noarch/repodata.json.zst

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f118101fc10>: Failed to establish a new connection: [Errno 111] Connection refused')': /anaconda/pkgs/free/linux-64/repodata.json

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f11810089d0>: Failed to establish a new connection: [Errno 111] Connection refused')': /anaconda/pkgs/main/noarch/repodata.json.zst

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1181009210>: Failed to establish a new connection: [Errno 111] Connection refused')': /pkgs/r/linux-64/repodata.json.zst

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1181009110>: Failed to establish a new connection: [Errno 111] Connection refused')': /anaconda/pkgs/main/linux-64/repodata.json.zst

Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f118100a090>: Failed to establish a new connection: [Errno 111] Connection refused')': /pkgs/main/noarch/repodata.json.zst
                                                                                                                                                                                                                                  failed

ProxyError: Conda cannot proceed due to an error in your proxy configuration.
Check for typos and other configuration errors in any '.netrc' file in your home directory,
any environment variables ending in '_PROXY', and any other system-wide proxy
configuration settings.

3.解决方案:

1.逐个输入以下命令,看是否在服务器上设置了代理

echo $http_proxy
echo $https_proxy 

unset http_proxy
unset https_proxy

cat ~/.condarc

我这边输入前4个没反应,输入最后一个命令后显示出此前设置了代理

2.执行下面的命令,删除代理

 conda config --remove-key proxy_servers

3.删除后再执行cat ~/.condarc命令,发现代理已被关闭

4.然后再正常执行创建conda环境的命令即可成功创建conda环境

 

5.执行conda activate envname命令激活conda环境 

ok,可以快乐编程了~~~ 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值