Anaconda正确使用方式

1. 下载地址

官方地址:https://www.anaconda.com/products/distribution
清华大学开源软件镜像站:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

2. 安装过程

注意选择这个,不需要再设置环境变量
image

3. 镜像配置

1、Anaconda 查看安装源:

conda config --show-sources

2、切换回Anaconda的默认源

conda config --remove-key channels

3、添加清华镜像源

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 --set show_channel_urls yes

4、查看镜像源配置

conda config --show

5、删除镜像源

conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

4.加快安装包速度

1、通过mamba安装包

mamba本身需要先通过conda来安装:
conda install -c conda-forge mamba

2、mamba使用方式

安装包:mamba install xxx
卸载包:mamba unistall xxx
移除包:mamba remove -n xxx XXX 第一个为环境名称,第二个为包名称
更新包:mamba update XXX
创建环境:mamba create -n XXX python=3.9
激活环境:conda activate XXX
退出环境:conda deactivate xxx
更新python mamba update python
移除环境:mamba remove -n XXX --all
导出环境:conda env export xxx.yaml
查看已安装包:mamba list
其它基本与conda一样,Mamba对conda install语句进行并行化改造,达到加速下载过程的目的。解决了conda安装包过程中,Solving environment卡住问题

参考资料:

  1. https://mamba.readthedocs.io/en/latest/user_guide/mamba.html
posted @ 2022-04-28 13:50  skypanxh  阅读(991)  评论(0编辑  收藏  举报