• 将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
  • 相关阅读:
    数据库排名函数(Rank)
    请求支付报表的测试
    DateTime详细资料转载
    sqlserver2005的安装问题
    Hdu 1398 Square Coins
    HDU 1709 The Balance
    POJ 1423 Big Number
    hdu 1106 排序
    HDU 1028 Ignatius and the Princess III
    并查集Is It A Tree?hdu 1325
  • 原文地址:https://www.cnblogs.com/howhy/p/13157138.html
Copyright © 2020-2023  润新知