zoukankan      html  css  js  c++  java
  • 【Python学习】pypi 软件源-pip

    国内源:

    anaconda配置镜像

    Mac and Linux

    1
    2
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    conda config --set show_channel_urls yes

     Windows

      windows下,直接在user目录中创建一个pip目录,如:C:Usersxxpip,新建文件pip.ini,内容如下

    1
    2
    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple

    pip配置镜像 

    Linux

    修改 ~/.pip/pip.conf (没有就创建一个), 修改 index-url至tuna,内容如下:

    1
    2
    [global]
     index-url = https://pypi.tuna.tsinghua.edu.cn/simple

     Windows

    直接在user目录中创建一个pip目录,如:C:Usersxxpip,新建文件pip.ini,内容如下

    1
    2
    [global]
     index-url = https://pypi.tuna.tsinghua.edu.cn/simple

     请注意:一定是在你个人用户文件夹下先建立pip文件夹,在建立pip.ini文件,不是直接把pip.ini文件放在C:Usersxx下

    pip临时镜像

    临时使用:

    可以在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple

    例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gevent,这样就会从清华这边的镜像去安装gevent库。

    当遇到pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Read timed out.

    比如我使用   :easy_install pip  就会出现这个超时,建议更换成豆瓣源使用   -i https://pypi.doubanio.com/simple

    pypi 软件源
    如何使用?
    pip install -i http://xxxxxx --trusted-host xxxxxxx PACKAGE1 PACKAGE2 ...
    
    或者修改默认配置, 编辑 ~/.pip/pip.conf
    [global]
    
    # 从官方源 https://pypi.python.org 同步, 10分钟同步一次
    index-url = http://xxxxxx
    
    # 内部私有pypi服务
    extra-index-url = http://xxxxxx
    
    [install]
    trusted-host = xxxxxx
    
    [list]
    
    # 解决pip list时显示警告问题
    
    format=columns
    
    如果你想上传包到内部pypi服务
    pip install pypi-uploader
    pypiupload packages ${package_path} -i http://xxxxxx
    View Code
    作者:gtea 博客地址:https://www.cnblogs.com/gtea
  • 相关阅读:
    数据要求说明书
    详细设计说明书
    《机器学习》西瓜书 课后习题参考答案
    机器学习基础 基本术语
    (转)android UI进阶之仿iphone的tab效果
    (转)android UI进阶之弹窗的使用
    (转) Android UI学习 Tab的学习和使用
    (转) android UI进阶之布局的优化(二)
    名言警句
    php的IP转换成整型函数ip2long()出现负数
  • 原文地址:https://www.cnblogs.com/gtea/p/12672773.html
Copyright © 2011-2022 走看看