Python_pip下載不下來源解決方案


 

pip安裝第三方庫報錯如下:

[root@besttest ld.so.conf.d]# pip3 install  xlrd
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting xlrd
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/xlrd/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/xlrd/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/xlrd/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/xlrd/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/xlrd/
  Could not fetch URL https://pypi.org/simple/xlrd/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/xlrd/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
  Could not find a version that satisfies the requirement xlrd (from versions: )
No matching distribution found for xlrd
You are using pip version 10.0.1, however version 19.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

 

解決方案:

pip3 install xlrd -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

原因:可能資源在國外服務器,導致下載不下來,加上豆瓣,表示去豆瓣源上下載,較國外網址快一些

其他源地址:

1)http://mirrors.aliyun.com/pypi/simple/ 阿里雲

2)https://pypi.mirrors.ustc.edu.cn/simple/  中國科技大學

3) http://pypi.douban.com/simple/  豆瓣

4) https://pypi.tuna.tsinghua.edu.cn/simple/ 清華大學

5)  http://pypi.mirrors.ustc.edu.cn/simple/ 中國科學技術大學


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM