ubuntu 更换pip源
发表于:2023-02-07 |

Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fb6084c50>: Failed to establish a new connection: [Errno 101] 网络不可达',)'

这种报错往往是pip源,更换源即可成功下载

1.在主目录创建.pip文件夹

sudo mkdir .pip

2.进入./pip文件夹

cd .pip

3.创建pip.conf文件

sudo touch pip.conf

4.打开pip.conf文件

sudo gedit pip.conf

5.Ctrl+A,Ctrl+V

 [global]
 timeout = 6000
 index-url = https://pypi.doubanio.com/simple
 trusted-host = pypi.doubanio.com

6.保存

上一篇:
pip 如何下载 whl 环境到无外网机器
下一篇:
错误解决办法:zipimport.ZipImportError: can't decompress data; zlib not available