下载python的第三方库经常会遇到timeout
解决办法:换下载源
清华:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云:http://mirrors.aliyun.com/pypi/simple/
豆瓣:http://pypi.douban.com/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
例如:安装MyQR,在后面加上 -i 加上上面的任一个网站。
pip install MyQR -i https://pypi.tuna.tsinghua.edu.cn/simple/
ps:如果还是超时的话,重新执行刚才的代码
或者可以设置一个默认超时时间。
在原先的代码上面加上–default-timeout=xxx (xxx表示时间) 或者重新执行刚才的上面一行代码
例如:
pip3 install MyQR