有关于Anaconda换源


一、Anaconda切换官方源(推荐使用官方源+梯子)

 1 # conda环境还源。宁愿用梯子使用国外官方源,也不用国内源
 2 # 查看anaconda配置镜像
 3 > conda config --show channels
 4 channels:
 5   - https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
 6   - anaconda-fusion
 7   - defaults
 8 # 删除所有源
 9 > conda config --remove-key channels
10 > conda config --show channels
11 channels:
12   - defaults
13 # 更新所有包
14 > conda update --all
15 > ...
16 
17 
18 # 其实,.condarc 这个文件在 C:\Users\Administrator
19 # 或者直接更改 ~/.condarc
20 > vim ~/.condarc
21 channels:
22   - defaults

 二、切换国内源

Conda配置国内镜像源

1 # 换回默认源(清除所有用户添加的镜像源路径,只保留默认的路径)
2 conda config --remove-key channels
3 vim ~/.condarc

镜像源


#清华源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
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/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2

 

#显示检索路径

conda config --set show_channel_urls yes

#显示镜像通道

conda config --show channels

从国内镜像源下载包

# 更换后面的源路径和需要安装的包名即可【强烈推荐】
pip install -U pandas -i https://pypi.tuna.tsinghua.edu.cn/simple

pip install -U networkx python-louvain tensorflow-gpu==1.12 -i https://pypi.tuna.tsinghua.edu.cn/simple

reference:

https://blog.csdn.net/taoyu94/article/details/108150892

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM