zoukankan      html  css  js  c++  java
  • 配置pip镜像源(转)

    使用pip安装python扩展时,如若没有配置国内镜像源,在未翻墙的情况下,其下载速度将会特别缓慢。因此,有些时候我们必须使用国内镜像源,来解决pip下载安装速度慢的问题,比较常用的国内镜像包括:

    阿里云:http://mirrors.aliyun.com/pypi/simple/
    豆瓣:http://pypi.douban.com/simple/
    清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
    中国科学技术大学:http://pypi.mirrors.ustc.edu.cn/simple/
    华中科技大学:http://pypi.hustunique.com/
    基于这些国内镜像源,在windows系统下,如果pip版本小于10.0.0,我们可通过在用户目录(Win XP:C:Documents and SettingsAdministratorpip;Win7及其以上系统:C:UsersUsernamepip)下新建pip.ini,并在文件中指定扩展源即可,具体示例(以清华大学为例)如下:

    [global]
    index-url=https://pypi.tuna.tsinghua.edu.cn/simple
    [install]
    trusted-host=pypi.tuna.tsinghua.edu.cn
    disable-pip-version-check = true
    timeout = 6000
    如果pip版本>=10.0.0,则可使用以下pip config set global.index-url命令进行配置,具体示例(以清华大学国内镜像源为例)如下:

    pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
    PS:如果仅是临时使用国内源,则可使用pip install -i命令指定当前安装所使用的镜像源即可,具体示例(以安装numpy为例)如下:

    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy
     
    转自(https://blog.csdn.net/zhoyuwo/article/details/100140034)

  • 相关阅读:
    git 问题集
    es7集群安装配置及常用命令
    idea maven项目操作kafka--生产者和消费者
    linux中kafka集群搭建及常用命令
    xampp 支持php版本,支持php5.2的最后一版xampp——xampp-1.7.1
    TCP和UDP的区别及各自优缺点区别
    Qt容器(QHash/QMap等)基本学习记录
    linux系统剪切
    简单网络IP探索
    C++(Qt)线程与锁
  • 原文地址:https://www.cnblogs.com/yigui/p/11863313.html
Copyright © 2011-2022 走看看