zoukankan      html  css  js  c++  java
  • Python pip安装第三方库的国内镜像

    Windows系统下,一般情况下使用pip在DOS界面安装python第三方库时,经常会遇到超时的问题,导致第三方库无法顺利安装,此时就需要国内镜像源的帮助了。

    使用方法如下:

    例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider,这样就会从清华这边的镜像去安装pyspider库。

    国内源:

    清华:https://pypi.tuna.tsinghua.edu.cn/simple

    阿里云:http://mirrors.aliyun.com/pypi/simple/

    中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

    华中理工大学:http://pypi.hustunique.com/

    山东理工大学:http://pypi.sdutlinux.org/ 

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

    note:新版ubuntu要求使用https源,要注意。

    临时使用:

    可以在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple
    例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider,这样就会从清华这边的镜像去安装pyspider库。

    永久修改,一劳永逸:

    Linux下,修改 ~/.pip/pip.conf (没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹)

    内容如下:

    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple
    [install]
    trusted-host=mirrors.aliyun.com

    windows下,直接在user目录中创建一个pip目录,再新建文件pip.ini。(例如:C:UsersWQPpippip.ini)内容同上。

  • 相关阅读:
    Intellij Idea 创建Web项目入门
    使用swagger作为restful api的doc文档生成
    SpringMVC中的参数绑定总结
    Spring注解@Resource和@Autowired区别对比
    java的(PO,VO,TO,BO,DAO,POJO)解释
    java有几种对象(PO,VO,DAO,BO,POJO)
    clone项目到本地
    修改虚拟机上Linux系统的IP地址
    虚拟机下CentOS 6.5配置IP地址的三种方法
    系统重启
  • 原文地址:https://www.cnblogs.com/guohongwei/p/10841025.html
Copyright © 2011-2022 走看看