ubuntu22.04安装anaconda
1.安装依赖包
sudo apt install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
2.查看系统架构
uname -m
dpkg --print-architecture
3.下载anaconda
Download Anaconda Distribution | AnacondaDownload Anaconda's open-source Distribution today. Discover the easiest way to perform Python/R data science and machine learning on a single machine.https://www.anaconda.com/download
安装miniconda流程也是一样,选右边即可
或在在这个里面找自己想要的版本
Index of /archivehttps://repo.anaconda.com/archive/下载过程比较慢,耐心等待
4.安装anaconda
在下载目录打开终端
bash Anaconda3-2025.06-0-Linux-x86_64.sh
一直enter键或在yes即可
5.添加环境变量
gedit .bashrc
若.bashrc文件里面没有添加
则手动在文件末端加入环境变量
export PATH=~/anaconda3/bin:$PATH
source ~/anaconda3/bin/activate
6.退出/进入(base)环境
(base) fishros@fishros-linux:~$ conda deactivate
fishros@fishros-linux:~$ source ~/anaconda3/bin/activate
(base) fishros@fishros-linux:~$
7.创建自己虚拟环境
conda create --name my_env python=3
conda activate my_env
8.卸载anaconda
在anaconda目录里直接bash uninstall.sh 输入yes即可
若anaconda被安装到root路径下
fishros@fishros-linux:~$ sudo su
(base) root@fishros-linux:/home/fishros# cd /root
(base) root@fishros-linux:~# cd anaconda3/
(base) root@fishros-linux:~/anaconda3#sudo bash uninstall.sh