zoukankan      html  css  js  c++  java
  • anaconda、pip配置国内镜像


    一、anaconda配置镜像
    查看源:conda config --show-sources
    在Mac and Linux下:
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    conda config --set show_channel_urls yes

    在Windows下,直接在user目录中创建一个pip目录,如:C:Usersxxpip,新建文件pip.ini,内容如下
    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple

    换回默认源:conda config --remove-key channels

    详细:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/

    或者:
    执行conda命令:conda config
    会创建conda的配置文件,使用search everything 查找 .condarc 并打开,在里面添加
    channels:
    - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    - defaults
    show_channel_urls: true

    https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#obtaining-information-from-the-condarc-file

    To get all keys and their values:

    conda config --get
    

    To get the value of a specific key, such as channels:

    conda config --get channels
    

    To add a new value, such as http://conda.anaconda.org/mutirri, to a specific key, such as channels:

    conda config --add channels http://conda.anaconda.org/mutirri
    

    To remove an existing value, such as http://conda.anaconda.org/mutirri from a specific key, such as channels:

    conda config --remove channels http://conda.anaconda.org/mutirri
    

    To remove a key, such as channels, and all of its values:

    conda config --remove-key channels
    

    To configure channels and their priority for a single environment, make a .condarc file in the root directory of that environment.


    二、pip配置镜像
    1.Linux下:
    修改 ~/.pip/pip.conf (没有就创建一个), 修改 index-url至tuna,内容如下:
    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple

    2.在Windows下:
    直接在user目录中创建一个pip目录,如:C:Usersxxpip,新建文件pip.ini,内容如下
    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple

    3.临时使用:
    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas

    4.pip国内源:

    新版ubuntu要求使用https源,要注意。

    清华:https://pypi.tuna.tsinghua.edu.cn/simple

    阿里云:http://mirrors.aliyun.com/pypi/simple/

    中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

    华中理工大学:http://pypi.hustunique.com/

    山东理工大学:http://pypi.sdutlinux.org/ 

    豆瓣:http://pypi.douban.com/simple/

     

  • 相关阅读:
    开窗函数Over
    CodeSmith
    codeMatic代码生成器
    Mvc身份认证方式
    Neo4j入门详细教程
    pathlib路径问题
    python_跨文件二维全局变量传参
    .md图片链接转存并替换路径,及相关报错解决方法
    ERROR: column "xxxxxx" does not exist解决办法
    SCP远程传输文件
  • 原文地址:https://www.cnblogs.com/timssd/p/10253266.html
Copyright © 2011-2022 走看看