python中安裝下載超時,下載不了安裝包

python3 -m pip install scapy

執行上面命令報錯,下載超時,下載不了安裝包python

Collecting scapy
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/52/e7/464079606a9cf97ad04936c52a5324d14dae36215f9319bf3faa46a7907d/scapy-2.4.3.tar.gz
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x00000227D115DD48>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/52/e7/464079606a9cf97ad04936c52a5324d14dae36215f9319bf3faa46a7907d/scapy-2.4.3.tar.gz
ERROR: Operation cancelled by user

 

 

 

解決辦法:阿里雲

pip install <包> -i <源> --trusted-host <源域名>

<包>爲你要下載的安裝包

例如:url

 pip install scapy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

 

 

附:spa

一些pip源code

阿里雲 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/
相關文章
相關標籤/搜索