一、安装步骤
(一)安装
下载地址:https://mirrors.tuna.tsinghua.edu.cn/
选项:anaconda-archive-Anaconda3-2021.05-Linux
bash anaconda-archive-Anaconda3-2021.05-Linux.sh
全程输入yes。
(二)换源
conda源,2022年亲测可用:
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
conda config --set show_channel_urls yes
sudo gedit ~/.condarc
删除第三行“- defaults”
二、使用方法
(一)环境操作
1、列出环境
conda env list #包含路径
2、创建环境
conda create -n py3env python=3.7 anaconda
3、激活环境
conda activate env_name
4、更改镜像源
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes # 搜索时显示通道地址
5、退出环境
conda deactivate
6、其他
conda create -n xiaolv --clone xiaolvshijie #复制环境
conda remove -n xiaolv --all #删除环境
(二)包操作
1、安装包
conda install pkg_name
conda install -n env_name pkg_name
2、升级包
conda list
三、安装gcc9和g++9
sudo apt-get update
sudo apt-get install build-essential software-properties-common -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install gcc-snapshot -y
sudo apt-get update
sudo apt-get install gcc-9 g++-9 -y
参考:
清华镜像安装:https://jingyan.baidu.com/article/574c5219d356c42d8d9dc1c9.html
Anaconda修改镜像源:https://blog.csdn.net/shahuhu000/article/details/82599166
ubuntu下安装:https://blog.csdn.net/qq_15192373/article/details/81091098
ubuntu修改清华源:https://www.cnblogs.com/chuqianyu/p/14321257.html