zoukankan      html  css  js  c++  java
  • 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命令安装速度非常快。

  • 相关阅读:
    新概念4-27
    胡雪岩06
    新概念4-26
    新概念4-25
    作业01
    day 01 小结
    计算机编程基础
    计算机组成
    markdown文档的编写
    zoj 2674 Strange Limit 欧拉定理应用 (3-E)
  • 原文地址:https://www.cnblogs.com/dudubao/p/9494092.html
Copyright © 2011-2022 走看看