zoukankan      html  css  js  c++  java
  • 005_解决pip国外安装源慢的问题

    用默认的pip安装源pypi.python.org由于在国外经常会出现超时的问题,而且安装速度极其的慢,如下图中的超时问题=>

    一、可通过以下方式解决。

    cat  ~/.pip/pip.conf 
    [global]
    timeout = 60     #设置超时时间
    index-url = http://pypi.douban.com/simple         #设置国内的镜像源,还有其他国内的源可以从网上进行搜索

    二、

    pip install salt-api==0.8.4.1
    Collecting salt-api==0.8.4.1
      The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host pypi.douban.com'.
    根据上面的提示pip安装的时候加上后面的参数,如下:
    pip install salt-api==0.8.4.1 --trusted-host pypi.douban.com
    或通过requirements文件进行软件的批量安装
    pip install -r requirements.txt --trusted-host pypi.douban.com
    Requirement already satisfied (use --upgrade to upgrade): simplegeneric==0.8.1 in /root/python_dev/.pyenv/versions/2.7.1/lib/python2.7/site-packages (from -r requirements.txt (line 1))
    Collecting singledispatch==3.4.0.3 (from -r requirements.txt (line 2))
      Downloading http://pypi.douban.com/packages/3.4/s/singledispatch/singledispatch-3.4.0.3-py2.py3-none-any.whl
    。。。。。。。。。。
    发现通过上面的方式速度快了很多,也没有上面出现的超时问题了



  • 相关阅读:
    python函数对象
    生成器表达式,列表推导式
    python转换excel成py文件
    Python处理excel表
    Go基础:接口相关
    JAVA03-输入和输出
    python6-while循环
    python5-字典
    自动化8-xpath
    网络学习day1-计算机网络基础
  • 原文地址:https://www.cnblogs.com/arun-python/p/5316738.html
Copyright © 2011-2022 走看看