pip install 第三方庫報錯


報錯 :Could not find a version that satisfies the requirement xlrd (from versions: )

No matching distribution found for xlrd

這是因為網絡的問題,需要使用國內的鏡像源來加速,比如豆瓣源

方式一:

命令改為:

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

或者

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

方案二:

設置延遲時間

命令:pip --default-timeout=100 install xlrd pip

方案三:

在pip安裝路徑下,創建python文件(.py)

import os  

ini="""[global] 
index-url = https://pypi.doubanio.com/simple/ 
[install] 
trusted-host=pypi.doubanio.com 
"""  
pippath=os.environ["USERPROFILE"]+"\\pip\\"  

if not os.path.exists(pippath):  
    os.mkdir(pippath)  

with open(pippath+"pip.ini","w+") as f:  
    f.write(ini)  

  在cmd上運行這個python文件,之后再用pip install命令安裝速度非常快。


免責聲明!

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



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