项目场景:
linux环境下需要更新pip工具
问题描述
升级pip3提示“网络不可达”
提示内容如下:
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x74e1f410>: Failed to establish a new connection: [Errno 101] 网络不可达')': /packages/c7/42/be1c7bbdd83e1bfb160c94b9cafd8e25efc7400346cf7ccdbdb452c467fa/setuptools-68.0.0-py3-none-any.whl
原因分析:
升级pip3报网络不可达的错,安装某些python包也失败,原始的pip3是从国外拿资源,速度慢,资源少,这里我们可以用华科大的镜像
解决方案:
使用如下更换国内中科大镜像源命令:
sudo pip3 install cython -i https://pypi.mirrors.ustc.edu.cn/simple/