問題:
安裝包出現Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError
解決辦法:
pip install boto3 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
國內一些源:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/
中國科學技術大學 http://pypi.mirrors.ustc.edu.cn/simple/
直接 -i 加 url 即可:
pip install boto3 -i http://pypi.douban.com/simple
如果出現不信用的資訊,加上
--trusted-host pypi.douban.com
就可以了
解決pip *.txt 超時和中止問題
自己寫一個腳本即可
import sys
from pip._internal import main as pip_main
def install(package):
pip_main(['--default-timeout=1000','install','-U', package])
if __name__=='__main__':
with open(sys.argv[1]) as f:
for line in f:
install(line)
運行命令
python <your_python_script_file_dir> <your_requirements_file_dir>
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/280361.html
標籤:python
