zoukankan      html  css  js  c++  java
  • python之更换pip默认安装源

    一、更换默认安装源

     1、Wndows系统

       在用户文件夹(C:Users对应用户目录)下创建pip目录,并在pip目录下创建pip.in文件(%HOMEPATH%pippip.ini),文件中添加如下内容:

    [global]
    trusted-host=mirrors.aliyun.com
    index-url=http://mirrors.aliyun.com/pypi/simple/

       备注:index-url即源地址,trusted-host为源地址的域名,由于国内的源镜像都为使用https协议,所以如果不添加信任域就会报:

       This repository located at mirrors.aliyun.com is not a trusted host, if this repository is available via HTTPS it is recommend to use HTTPS instead, otherwise you may silence this warning with                              ‘–trusted-host mirrors.aliyun.com’.

       DEPRECATION: Implicitly allowing locations which are not hosted at a secure origin is deprecated and will require the use of –trusted-host in the future.

     2、Linux系统

      linux的文件在~/.pip/pip.conf

    [global]
    trusted-host=mirrors.aliyun.com
    index-url=http://mirrors.aliyun.com/pypi/simple/

       3、手动指定:

      pip install -i http://<mirror>/simple <package> 或pip install  <package> -i http://<mirror>/simple

      例如:pip install -i http://mirrors.aliyun.com/pypi/simple/

  • 相关阅读:
    P4556 [Vani有约会]雨天的尾巴(线段树合并)
    bzoj3590: [Snoi2013]Quare
    P3187 [HNOI2007]最小矩形覆盖
    对文件中的名字进行随机抽选(小脚本)
    用shell编写一个三角形图案
    HUE安装与使用
    史上最全CentOS6离线安装部署Cloudera Manager5.9.3
    ReLU 函数
    关于反向传播
    关于微分
  • 原文地址:https://www.cnblogs.com/Inbreeze/p/14176035.html
Copyright © 2011-2022 走看看