zoukankan      html  css  js  c++  java
  • Pip安装使用国内源的两种方法

    pip安装后使用pip安装第三方库默认使用的是国外源,一般安装慢而且不是很稳定,结果还会提示安装失败。

    国外源不行,可以使用国内源,使用国内源一般有两种方法

    1.临时更换

    在安装的时候带上参数 -i 国内源地址

    例如: pip install pytest -i https://pypi.tuna.tsinghua.edu.cn/simple/

    2. 永久更换(后续安装的时候不用再带参数)

    在C:Users用户 下面创建文件夹,命名为pip, 再在pip文件夹下面创建pip.ini文件, 文件内容如下:

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

    设置成功后, 再次使用pip安装无需带参数, 会自动从国内源地址下载

    对了, 这里贴上比较稳定的几个国内源镜像文件地址, 需要的自取.

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

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

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

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

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

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

  • 相关阅读:
    使用JSONPath
    JSON 返回值JSONPath Syntax
    IntelliJ IDEA 打包Maven 构建的 Java 项目
    JMeter(7) 优化判断返回类型和返回值
    Windows copy
    Windows del
    Windows exit
    Windows netsh
    Windows start
    Windows taskkill
  • 原文地址:https://www.cnblogs.com/yunxintryyoubest/p/13949292.html
Copyright © 2011-2022 走看看