第1步:下载Anaconda安装脚本

适用于Linux系统的Anaconda附带自己的安装脚本。

我们需要做的就是下载并安装,它将根据系统设置的其余部分。

https://www.anaconda.com/distribution/

然后选择Linux版本并下载。

下载后,我们可以在下面的命令中运行以下命令,假设该文件在主目录的下载文件夹中下载。

如何在Ubuntu 上安装Anaconda

Anaconda是世界上最受欢迎的Python/R数据科学和机器学习平台

要开始安装Anaconda,请按照以下步骤操作:

第2步:运行anaconda安装脚本

转到我们下载脚本的位置,运行它

cd ~/Downloads

或者我们可以运行直接运行以下命令下载。

cd /tmp
wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh

下载脚本后,运行以下命令以开始安装。

bash Anaconda3-2019.10-Linux-x86_64.sh

我们应该看到如下所示的输出:

Welcome to Anaconda3 2019.10
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>

点击ENTER键继续 。

出现提示 是否同意许可条款,回答yes。

Do you accept the license terms? [yes|no]
[no] >>> yes

然后继续

Anaconda将在主目录中选择要安装的默认位置。
如果我们不想更改,请按Enter继续

Anaconda3 will now be installed into this location:
/home/jack/anaconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/home/jack/anaconda3] >>>

在那之后是的

Preparing transaction: done
Executing transaction: done
installation finished.
Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
[no] >>> yes

并继续

安装后,我们应该看到以下消息:

==> For changes to take effect, close and re-open your current shell. <==
If you'd prefer that conda's base environment not be activated on startup,
set the auto_activate_base parameter to false:
conda config --set auto_activate_base false
Thank you for installing Anaconda3!
===========================================================================
Anaconda and JetBrains are working together to bring you Anaconda-powered
environments tightly integrated in the PyCharm IDE.
PyCharm for Anaconda is available at:
https://www.anaconda.com/pycharm

接下来,打开一个新的Ubuntu终端会话,以便更改生效。

或者只需运行以下命令 以便加载Anaconda安装新的路径环境变量,该变量被添加到当前shell会话中

source ~/.bashrc

要验证是否已安装anaconda,键入以下命令:

conda info

我们应该看到类似于下面的输出:

(base) jack@ubuntu1804:~$conda info
     active environment : base
    active env location : /home/jack/anaconda3
            shell level : 1
       user config file : /home/jack/.condarc
 populated config files : 
          conda version : 4.7.12
    conda-build version : 3.18.9
         python version : 3.7.4.final.0
       virtual packages : 
       base environment : /home/jack/anaconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/jack/anaconda3/pkgs
                          /home/jack/.conda/pkgs
       envs directories : /home/jack/anaconda3/envs
                          /home/jack/.conda/envs
               platform : linux-64
             user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.4 Linux/5.0.0-32-generic ubuntu/18.04.3 glibc/2.27
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

如果要更新anaconda,只需运行以下命令:

conda update conda

出现提示时,键入Y 开始更新

日期:2020-07-07 20:57:11 来源:oir作者:oir