zoukankan      html  css  js  c++  java
  • Anaconda配置国内镜像源

    1. 为conda配置(清华)镜像源

    使用conda进行安装时,访问的是国外的网络,所以下载和安装包时会特别慢。我们需要更换到国内镜像源地址,这里我更换到国内的清华大学地址。(永久添加镜像)

    Windows和Linux 对于conda修改镜像源的方法一样

    1.添加清华镜像:

    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
    #设置搜索时显示通道地址
    conda config --set show_channel_urls yes

    2.显示添加的源

    conda config --show channels

    3.删除指定源

    conda config --remove channels 源名称或链接 

    2. 为pip配置国内镜像源

    2.1 配置pip镜像源(临时修改的方法)

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

    例如:

    pip install numpy -i https://mirrors.aliyun.com/pypi/simple/

    国内常用源镜像地址:

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

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

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

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

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

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

    2.2配置pip镜像源(永久有效)

    1.Windows系统

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

    [global]  
    index-url = https://mirrors.aliyun.com/pypi/simple/

    2.Linux系统

    mkdir ~/.pip
    cd ~/.pip
    vim pip.conf

    内容和上面的一样

    [global]  
    index-url = https://mirrors.aliyun.com/pypi/simple/

    因上求缘,果上努力~~~~ 作者:每天卷学习,转载请注明原文链接:https://www.cnblogs.com/BlairGrowing/p/15265922.html

  • 相关阅读:
    NJUPT_Wrj 个人训练实录
    图片保存本地,上传阿里云,保存该图片 在阿里云的 路径 到 本地数据库
    微信所有国家列表
    YII load()
    ab命令压力测试
    fatal: Could not read from remote repository
    JS获取URL中参数值的4种方法
    yii 生成 模型
    php子类是否自动调用父类构造函数
    自己实现一个简化版的SpringMVC框架
  • 原文地址:https://www.cnblogs.com/BlairGrowing/p/15265922.html
Copyright © 2011-2022 走看看