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
    。。。。。。。。。。
    发现通过上面的方式速度快了很多,也没有上面出现的超时问题了



  • 相关阅读:
    bootstrap基础(四)
    bootstrap基础(三)
    bootstrap基础(二)
    python @staticmethod和@classmethod
    python的数据类型可变不可变
    json.dumps()和json.loads()和eval()
    Linux如何查看端口状态
    python 同时遍历两个list
    dogedoge浏览器爬取标题
    虚拟机数据库连接Windows本地数据库
  • 原文地址:https://www.cnblogs.com/arun-python/p/5316738.html
Copyright © 2011-2022 走看看