python离线安装pip出现timeout_Python pip安装包出现timeout的解决办法,修改国内的镜像源...
今天安裝django時老是出現(xiàn)timeout
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after conn
ection broken by 'ConnectTimeoutError(
at 0x00000000044BC9B0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/diango/
解決的方法
1.設(shè)置超時時間
pip --default-timeout=1000 install django
2.切換國內(nèi)的鏡像源
(1)臨時修改
使用pip的時候在后面加上-i參數(shù),指定pip源
eg:
pip install -i https://pypi.douban.com/simple django
(2)永久修改
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip.ini的內(nèi)容
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
常用的鏡像源
阿里云:https://mirrors.aliyun.com/pypi/simple/
中國科技大學(xué):https://pypi.mirrors.ustc.edu.cn/simple/
清華大學(xué):https://pypi.tuna.tsinghua.edu.cn/simple/
豆瓣:http://pypi.douban.com/simple/
總結(jié)
以上是生活随笔為你收集整理的python离线安装pip出现timeout_Python pip安装包出现timeout的解决办法,修改国内的镜像源...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 加99元秒升5G!中国联通推出华为P50
- 下一篇: 网络主播帝师偷逃税被查 罚款超1000万