zoukankan      html  css  js  c++  java
  • 使用pypi镜像源加速第三方库在线安装

    用easy_install和pip来安装第三方库很方便
    它们的原理其实就是从Python的官方源pypi.python.org/pypi 下载到本地,然后解包安装。
    不过因为某些原因,访问官方的pypi不稳定,很慢甚至访问不了。
    跟ubuntu的apt和centos的yum有各个镜像源一样,pypi也有。
    在国内的强烈推荐豆瓣的源
    http://pypi.douban.com/simple/ 
    注意后面要有/simple目录。

    使用镜像源很简单,用-i指定就行了:
    easy_install -i http://pypi.douban.com/simple/ gevent
    pip install -i http://pypi.douban.com/simple/ gevent

    如果觉得太麻烦,可以配制成默认:
    linux下,修改~/.pip/pip.conf,如果没这文件则创建。
    windows下,修改%HOMEPATH%pippip.ini。
    内容为:
    [global]
    index-url = http://pypi.douban.com/simple

    这样在使用pip来安装时,会默认使用此源。


    注:可以看到,豆瓣的源速度快的明显。



  • 相关阅读:
    concate string when group by
    Regular Expression
    Login failed for user
    SQL Performance Tools
    Web References
    ARTetris-AR版俄罗斯方块的源码解析
    ARKit_1
    链表
    线性表
    ORB-SLAM2的特征提取算法
  • 原文地址:https://www.cnblogs.com/chenjianhong/p/4144378.html
Copyright © 2011-2022 走看看