centos 7安装Anaconda

CentOS 7安装Anaconda3

  1. 执行下面的命令将执行脚本获取到本地(文件名可能因为版本不同有所差异): wget https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
  2. 执行bash Anaconda3-5.3.1-Linux-x86_64.sh进行Anaconda的安装
  3. 进入安装程序,提示输入“ENTER”继续: Please, press ENTER to continue >>> ENTER
  4. 输入yes确认接受许可协议 Do you accept the license terms? [yes|no] [no] >>> yes
  5. 确认Anaconda的安装位置, 可改可不改 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] >>> /opt/anaconda3 其实安装位置可以在执行安装脚本的时候直接指定,像上面要指定安装到/opt/anaconda3目录下,可以这样修改执行内容:bash bash Anaconda3-5.3.1-Linux-x86_64.sh -p /opt/anaconda3,这样这一步就可以直接回车了。
  6. 安装完成后,出现询问是否在用户的.bashrc文件中初始化Anaconda3的相关内容。 Do you wish the installer to initialize Anaconda3 by running conda init? [yes|no] [no] >>> yes
  7. 执行下:source ~/.bashrc,之后就可以正常使用了。

补充:

配置其他用户可用,将安装脚本添加到.bashrc文件中内容添加到/etc/bashrc中。内容大致是下面这个样子的, 然后执行source /etc/bashrc # added by Anaconda3 5.3.1 installer # >>> conda init >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$(CONDA_REPORT_ERRORS=false '/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)" if [ $? -eq 0 ]; then \eval "$__conda_setup" else if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then . "/opt/anaconda3/etc/profile.d/conda.sh" CONDA_CHANGEPS1=false conda activate base else \export PATH="/opt/anaconda3/bin:$PATH" fi fi 复制代码

首先在官网下载对应版本

1.Anaconda3-2021.05-Linux-x86_64.sh

2.bash Anaconda3-2021.05-Linux-x86_64.sh执行此命令(pwd查看当前位置,要先对应到当前位置)

剩余步骤同上

原文地址:https://www.cnblogs.com/nenu/p/15443178.html