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
  • 相关阅读:
    CSS+JS实现兼容性很好的无限级下拉菜单
    自动切换的JS菜单
    (2)C#连sqlite
    protobuf编译器
    (67) c# 序列化
    (66) c# async await
    (65)C# 任务
    mbatis 入门
    (64)C# 预处理器指令
    (63)C# 不安全代码unsafe
  • 原文地址:https://www.cnblogs.com/howhy/p/13157138.html
Copyright © 2011-2022 走看看