Linux(centos, ubuntu) 快速安装anaconda;5秒安装anaconda

1.下载Anaconda安装脚本:

首先,访问Anaconda的官方下载页面:https://www.anaconda.com/products/distribution

在页面上,选择适用于Linux的Python 3.x版本的Anaconda安装脚本。也可以使用wget或curl命令从终端下载。示例:

bash 复制代码
wget https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh

2.执行安装脚本

有两种方式:

第一种:

bash 复制代码
bash Anaconda3-2023.09-0-Linux-x86_64.sh

第二种:

bash 复制代码
-- 让脚本可执行
chmod +x Anaconda3-2023.09-0-Linux-x86_64.sh
-- 执行脚本
./Anaconda3-2023.09-0-Linux-x86_64.sh

3.安装过程

1.查看安装协议,按下enter查看,如果enter之后不想查看,直接ctrl+c即可到下一步

bash 复制代码
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> 

2.是否接受协议,输入yes

bash 复制代码
Do you accept the license terms? [yes|no]
[no] >>> yes

3.选择安装目录,有三种选择

  • 按下enter直接安装到/root/anaconda3目录下
  • 按下ctrl+c退出安装
  • 指定安装位置,输入自己的安装路径;如果只输入了一个目录,则会安装到执行命令的目录下。
bash 复制代码
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

[/root/anaconda3] >>> anaconda

4.是否自动化conda环境

大致内容如下:

  • 每次启动终端,是否自动激活conda环境,默认环境通常是base,
  • 自动激活会更新系统配置文件,启动终端时,会提示你激活的是哪个conda环境
  • 如果不希望每次启动终端都激活conda环境,执行命令:conda config --set auto_activate_base false
  • 如果开始选择自动化初始conda,但后来不决定这么做,可以执行命令:conda init --reverse $SHELL
bash 复制代码
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

5.测试安装

重新打开窗口,验证conda是否安装成功

bash 复制代码
conda list

安装anaconda后,就可以使用conda来创建新的环境、安装包、更新包等。anaconda可能会占用大量磁盘空间,它包含了许多预安装的库,如果不需要预安装很多库,可以使用miniconda。

相关推荐
热爱嵌入式的小许15 分钟前
Linux基础项目开发1:量产工具——显示系统
linux·运维·服务器·韦东山量产工具
韩楚风4 小时前
【linux 多进程并发】linux进程状态与生命周期各阶段转换,进程状态查看分析,助力高性能优化
linux·服务器·性能优化·架构·gnu
陈苏同学4 小时前
4. 将pycharm本地项目同步到(Linux)服务器上——深度学习·科研实践·从0到1
linux·服务器·ide·人工智能·python·深度学习·pycharm
Ambition_LAO4 小时前
解决:进入 WSL(Windows Subsystem for Linux)以及将 PyCharm 2024 连接到 WSL
linux·pycharm
Pythonliu74 小时前
茴香豆 + Qwen-7B-Chat-Int8
linux·运维·服务器
你疯了抱抱我4 小时前
【RockyLinux 9.4】安装 NVIDIA 驱动,改变分辨率,避坑版本。(CentOS 系列也能用)
linux·运维·centos
追风赶月、4 小时前
【Linux】进程地址空间(初步了解)
linux
栎栎学编程4 小时前
Linux中环境变量
linux
挥剑决浮云 -5 小时前
Linux 之 安装软件、GCC编译器、Linux 操作系统基础
linux·服务器·c语言·c++·经验分享·笔记
小O_好好学6 小时前
CentOS 7文件系统
linux·运维·centos