Anaconda配置国内镜像源 |
您所在的位置:网站首页 › 清华镜像服务器配置 › 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 yes2.显示添加的源 conda config --show channels3.删除指定源 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:\Users\xx\pip,新建文件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/3.下载测试 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |