zoukankan      html  css  js  c++  java
  • pip安装python库时使用国内镜像资源加速下载过程

    pip默认安装包是从网站https://pypi.org/simple下载,我们可以将其改成国内的镜像网站,加速下载过程,下面以安装numpy库为例:

    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy

    下载其它库时,将numpy改成需要的库名即可。(使用pip、pip2 or pip3根据指向的python版本即可确定。)

    在终端中输入pip install -help可以发现参数"-i"的作用:

    Package Index Options:
      -i, --index-url <url>       Base URL of Python Package Index (default
                                  https://pypi.org/simple). This should point to a
                                  repository compliant with PEP 503 (the simple
                                  repository API) or a local directory laid out in
                                  the same format.

    清华镜像资源:

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

  • 相关阅读:
    HOWTO re
    数据类型
    字符串
    最大公约数
    this
    tip 2:找最小公倍数之Boost
    tip 1:一个简单的将int型转换成char的方法
    Item47
    成员函数模板
    item44:将与参数无关的代码抽离template
  • 原文地址:https://www.cnblogs.com/wuliytTaotao/p/9457159.html
Copyright © 2011-2022 走看看