HTTPConnectionPool(host=‘127.0.0.1‘, port=44245) 解决方案

Error:

1. 访问网络时

requests.exceptions.ProxyError: HTTPConnectionPool(host=‘127.0.0.1’, port=44245): Max retries exceeded with url ... (Caused by ProxyError(‘Cannot connect to proxy.’, NewConnectionError(’: Failed to establish a new connection: [Errno 111] Connection refused’,)))

2. 或者在使用Conda时

botocore.exceptions.ProxyConnectionError: Failed to connect to proxy URL: “http://127.0.0.1:44245/”


在Ubuntu中使用代理服务器后,修改代理的配置后或者删除,原来的配置还是存在的,导致不能联网

解决方案: Ubuntu 删除 Proxy

1. 查看当前使用代理,如果有,需要去掉

env | grep -i proxy

输出:

NO_PROXY=localhost,127.0.0.0/8,::1
HTTPS_PROXY=http://127.0.0.1:44245/
no_proxy=localhost,127.0.0.0/8,::1
HTTP_PROXY=http://127.0.0.1:44245/

2. 去掉所有代理

unset HTTP_PROXY
unset HTTPS_PROXY

3. OK!

4. (Optional)若还是无法解决:

export HTTP_PROXY=""
export HTTP_PROXY=""
export http_proxy=""
export https_proxy=""

【注】经常是python2有问题切换到python3就可以。

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