今早发现pip命令下载包一直提示超时ConnectTimeoutError,然后通过浏览器登录豆瓣源发现地址重定向到了http://pypi.doubanio.com/simple。URL发生了改变因此发生了超时。
报错提示:
Looking in indexes: http://pypi.douban.com/simple
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPCo
nnection object at 0x000001D763928CA0>, ‘Connection to pypi.douban.com timed out. (connect timeout=15)’)’: /simple/sqlalchemy/
大致含义就是找不到网页,一直连接不上,然后使用浏览器打开发现豆瓣源地址重定向了。
解决办法
切换下载源,切换为清华源,也可以切换为豆瓣新源。
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
如下图所示: