起首,访问 Anaconda 官方网站的下载页面,下载适用于 Linux 的 Anaconda 安装脚本。通常,下载链接为:
cd ~/Downloads 切换到工作目次下载安装脚本
wget https://repo.anaconda.com/archive/Anaconda3-2024.02-1-Linux-x86_64.sh
运行安装脚本
通过以下命令使下载的脚本可执行,并运行它:
bash Anaconda3-2024.02-1-Linux-x86_64.sh
按照屏幕上的提示完成安装,同意许可协议,选择安装位置(默认通常即可),并决定是否将 Anaconda 的 bin 目次添加到你的 PATH 情况变量中。
Anaconda3 will now be installed into this location:
/root/anaconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
Installed package of scikit-learn can be accelerated using scikit-learn-intelex.
More details are available here: https://intel.github.io/scikit-learn-intelex
For example:
$ conda install scikit-learn-intelex
$ python -m sklearnex my_application.py
installation finished.
Do you wish to update your shell profile to automatically initialize conda?
This will activate conda on startup and change the command prompt when activated.
If you'd prefer that conda's base environment not be activated on startup,
run the following command when conda is activated:
conda config --set auto_activate_base false
You can undo this by running `conda init --reverse $SHELL`? [yes|no]
[no] >>> yes
no change /root/anaconda3/condabin/conda
no change /root/anaconda3/bin/conda
no change /root/anaconda3/bin/conda-env
no change /root/anaconda3/bin/activate
no change /root/anaconda3/bin/deactivate
no change /root/anaconda3/etc/profile.d/conda.sh
no change /root/anaconda3/etc/fish/conf.d/conda.fish
no change /root/anaconda3/shell/condabin/Conda.psm1
no change /root/anaconda3/shell/condabin/conda-hook.ps1
no change /root/anaconda3/lib/python3.11/site-packages/xontrib/conda.xsh
no change /root/anaconda3/etc/profile.d/conda.csh
modified /root/.bashrc
更改情况配置
source /root/.bashrc
验证安装
安装完成后,重启终端会话(或者重新登录),然后输入以下命令来验证 Anaconda 是否正确安装:
conda list
Miniconda版本也类似Anaconda的安装 配置 Conda