zoukankan      html  css  js  c++  java
  • 将pip源更换到国内镜像

    将pip源更换到国内镜像
    用pip管理工具安装库文件时,默认使用国外的源文件,因此在国内的下载速度会比较慢,可能只有50KB/s。幸好,国内的一些顶级科研机构已经给我们准备好了各种镜像,下载速度可达2MB/s。
    其中,比较常用的国内镜像包括:

    (1)阿里云 http://mirrors.aliyun.com/pypi/simple/
    (2)豆瓣http://pypi.douban.com/simple/
    (3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
    (4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
    (5)华中科技大学http://pypi.hustunique.com/

    方式一:临时使用国内pypi镜像安装

    pip install -i http://pypi.douban.com/simple/ numpy
    pip install -i http://pypi.douban.com/simple/--trusted-host pypi.douban.com  #此参数“--trusted-host”表示信任,如果上一个提示不受信任,就使用这个

    方式二:永久使用国内pypi镜像安装

    有没有什么办法,可以像往常一样,只使用pip install <包名>,但是直接使用指定的镜像源呢?

    windows环境:

    pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

     centOS7环境:

    (pd_test) [root@67 ~]# pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
    Writing to /root/.config/pip/pip.conf
  • 相关阅读:
    poj 2777 Count Color
    poj 3264 Balanced Lineup
    hdu 1754 I hate it
    poj 3468 A Simple Problem with Integers
    noip 2013 提高组 Day2 部分题解
    [c/c++]指针(2)
    [c/c++]指针(1)
    vijos 1360 八数码问题
    [复习]快速幂算法
    noip 2013 提高组 day1
  • 原文地址:https://www.cnblogs.com/howhy/p/13157138.html
Copyright © 2011-2022 走看看