zoukankan      html  css  js  c++  java
  • python-源管理 pip & conda

    更换pip源:

    1、在windows文件管理器中,输入 %APPDATA%

    2、在该目录下新建pip文件夹,然后到pip文件夹里面去新建个pip.ini文件

    3、在新建的pip.ini文件中输入以下内容

    [global]
    timeout = 6000
    trusted-host = pypi.douban.com
     

    更换conda源:

    1、在cmd下输入:conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    2、在cmd下输入:conda config --set show_channel_urls yes

    pip

    Windows

    Windows 下的 pip 配置文件路径:%HOMEPATH%/pip/pip.ini 文件,如不存在则新建,在其中写入:

    [global]
    index-url = http://pypi.douban.com/simple
    trusted-host = pypi.douban.com
    disable-pip-version-check = true
    timeout = 120
    
    [install]
    ignore-installed = true
    # 不自动安装依赖的时候设置此选项
    # no-dependencies = yes
    
    [list]
    format = columns

    注:

    • index-url - 使用豆瓣源
    • format - 当运行 pip list 命令时,等效于 pip list --format=columns,避免出现相关警告。

    Linux

    Linux 系统pip配置文件默认路径为:

    ~/.pip/pip.conf

    如果用的阿里云,则默认配置文件为:

    [global]
    index-url = http://mirrors.aliyun.com/pypi/simple/
    
    [install]
    trusted-host=mirrors.aliyun.com

    但是阿里云pypi更新比较缓慢,换成注释掉相关配置,换成官方源。
    另附清华源配置:

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

    conda

    设置清华大学镜像:

    conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
    conda config --set show_channel_urls yes
     
     
  • 相关阅读:
    软件架构设计箴言理解
    解决vs2010没有NET Framework 2.0和3.5
    .NET连接数据库实例
    CSS选择器大全
    SilverLight全屏代码
    SilverLight数字时钟 > 我的博客有SilverLight了
    comboBox设置为只读(只选)
    WinForm 单例模式实例
    标识种子和标识增量
    jQuery固定DIV实现“返回顶部”
  • 原文地址:https://www.cnblogs.com/mirrorlake/p/8861921.html
Copyright © 2011-2022 走看看