Q1: conda虚拟环境下使用pip安装软件报错:

WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbef88eaef0>: Failed to establish a new connection: [Errno 111] Connection refused',))': /simple/pytorch/ ERROR: Could not find a version that satisfies the requirement pytorch (from versions: none) ERROR: No matching distribution found for pytorch

A2:因为我用来clash的代理,但不清楚加在哪里了

env | grep -i "_proxy"

获得如下信息
在这里插入图片描述
需要在该终端关闭代理,在该终端下就可以使用pip了

unset http_proxy
unset socks_proxy
unset https_proxy

如果需要永久设置,就写道bash里面去吧

Q2:拉取网上信息的urllib.request.Request报错urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

A2:Q1中的问题也会导致这个报错,不妨一试

尝试过的方法:
  1. 设置国内源》https://blog.csdn.net/angelia620/article/details/106334937
  2. /etc/environment下删除代理,但我的代理信息不在这个位置》https://blog.csdn.net/myli_binbin/article/details/89633512
参考

https://blog.csdn.net/littlehaes/article/details/103518285

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐