CondaHTTPError: HTTP 000 CONNECTION FAILED for url
程序员文章站
2022-05-31 21:45:59
...
莫名奇妙的遇到一个坑,CondaHTTPError: HTTP 000 CONNECTION FAILED for url
错误:
[email protected]:~$ conda update --all
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/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.
ProxyError(MaxRetryError("HTTPSConnectionPool(host='mirrors.tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /anaconda/cloud/msys2/noarch/repodata.json (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3b217a7fd0>: Failed to establish a new connection: [Errno 111] Connection refused',)))",),)
网上很多解决办法就是,更改为清华源,修改后的源为:
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
show_channel_urls: true
但是,这并不能解决我的问题,还是提示错误。终于让我找到一个厉害的博客,写的很好,
https://www.imooc.com/article/37905
使用netstat
查看本地端口的使用情况
[email protected]:~$ sudo netstat -ntpl
[sudo] password for ubuntu:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 1336/dnsmasq
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 979/cupsd
tcp6 0 0 ::1:631 :::* LISTEN 979/cupsd
查看本地网络是否走了代理服务
[email protected]:~$ export | grep -i prox
declare -x HTTPS_PROXY="http://127.0.0.1:33421/"
declare -x HTTP_PROXY="http://127.0.0.1:33421/"
declare -x NO_PROXY="localhost,127.0.0.0/8,::1"
declare -x http_proxy="http://127.0.0.1:33421/"
declare -x https_proxy="http://127.0.0.1:33421/"
declare -x no_proxy="localhost,127.0.0.0/8,::1"
关闭服务
[email protected]:~$ unset HTTPS_PROXY(请注意大小写,应与declare -x HTTPS_PROXY="http://127.0.0.1:33421/"一致)
[email protected]:~$ export | grep -i prox
declare -x HTTP_PROXY="http://127.0.0.1:33421/"
declare -x NO_PROXY="localhost,127.0.0.0/8,::1"
declare -x http_proxy="http://127.0.0.1:33421/"
declare -x no_proxy="localhost,127.0.0.0/8,::1"
验证
[email protected]:~$ conda update --all
Solving environment: -
Warning: 2 possible package resolutions (only showing differing packages):
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free::blas-1.0-mkl
- defaults::blas-1.0-mdone
## Package Plan ##
environment location: /home/ubuntu/anaconda2
The following packages will be downloaded:
package | build
---------------------------|-----------------
blas-1.0 | mkl 6 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
The following packages will be UPDATED:
blas: 1.0-mkl defaults --> 1.0-mkl https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
Proceed ([y]/n)? Y
Downloading and Extracting Packages
blas-1.0 | 6 KB | ##################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
深深的叹一口气(唉~)
上一篇: oracle数据库基本查询操作
下一篇: 数据库基本操作二(子查询)
推荐阅读
-
使用nginx代理gogs遇到推送代码错误的问题(RPC failed; HTTP 413 curl 22 The requested URL returned error: 413)
-
使用nginx代理gogs遇到推送代码错误的问题(RPC failed; HTTP 413 curl 22 The requested URL returned error: 413)
-
anaconda下载包时网络连接错误(CondaHTTPError:HTTP 000 connection failed for url)
-
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
-
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
-
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
-
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
-
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
-
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
-
error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500 Internal Server Error