如何在Ubuntu 18.04上安装Anaconda [快速入门]

介绍 (Introduction)

Designed for data science and machine learning workflows, Anaconda is an open-source package manager, environment manager, and distribution of the Python and R programming languages.

Anaconda专为数据科学和机器学习工作流而设计,是一个开源软件包管理器,环境管理器以及Python和R编程语言的发行版。

This tutorial will guide you through installing Anaconda on an Ubuntu 18.04 server. For a more detailed version of this tutorial, with better explanations of each step, please refer to How To Install the Anaconda Python Distribution on Ubuntu 18.04.

本教程将指导您在Ubuntu 18.04服务器上安装Anaconda。 有关本教程的更详细版本,以及每个步骤的详细说明,请参阅如何在Ubuntu 18.04上安装Anaconda Python发行版

步骤1 —检索最新版本的Anaconda (Step 1 — Retrieve the Latest Version of Anaconda)

From a web browser, go to the Anaconda Distribution page, available via the following link:

在网络浏览器中,转到“ Anaconda分发”页面 ,可通过以下链接访问该页面

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

Find the latest Linux version and copy the installer bash script.

查找最新的Linux版本并复制安装程序bash脚本。

步骤2 —下载Anaconda Bash脚本 (Step 2 — Download the Anaconda Bash Script)

Logged into your Ubuntu 18.04 server as a sudo non-root user, move into the /tmp directory and use curl to download the link you copied from the Anaconda website:

以sudo非root用户身份登录到Ubuntu 18.04服务器,进入/tmp目录并使用curl下载从Anaconda网站复制的链接:

  • cd /tmp

    cd / tmp
  • curl -O https://repo.anaconda.com/archive/Anaconda3-2019.03-Linux-x86_64.sh

    curl -O https://repo.anaconda.com/archive/Anaconda3- 2019.03 -Linux-x86_64.sh

步骤3 —验证安装程序的数据完整性 (Step 3 — Verify the Data Integrity of the Installer)

Ensure the integrity of the installer with cryptographic hash verification through SHA-256 checksum:

通过SHA-256校验和通过加密哈希验证来确保安装程序的完整性:

  • sha256sum Anaconda3-2019.03-Linux-x86_64.sh

    sha256sum Anaconda3- 2019.03 -Linux-x86_64.sh


   
   
Output
45c851b7497cc14d5ca060064394569f724b67d9b5f98a926ed49b834a6bb73a Anaconda3-2019.03-Linux-x86_64.sh

第4步—运行Anaconda脚本 (Step 4 — Run the Anaconda Script)

  • bash Anaconda3-2019.03-Linux-x86_64.sh

    bash Anaconda3- 2019.03 -Linux-x86_64.sh

You’ll receive the following output to review the license agreement by pressing ENTER until you reach the end.

通过按ENTER直到结束,您将收到以下输出以查看许可协议。


   
   
Output
Welcome to Anaconda3 2019.03 In order to continue the installation process, please review the license agreement. Please, press ENTER to continue >>> ... Do you approve the license terms? [yes|no]

When you get to the end of the license, type yes as long as you agree to the license to complete installation.

当您到达许可证末尾时,只要您同意许可证即可完成安装,请键入yes

步骤5 —完整的安装过程 (Step 5 — Complete Installation Process)

Once you agree to the license, you will be prompted to choose the location of the installation. You can press ENTER to accept the default location, or specify a different location.

同意许可后,将提示您选择安装位置。 您可以按ENTER接受默认位置,或指定其他位置。


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

At this point, the installation will proceed. Note that the installation process takes some time.

此时,将继续安装。 请注意,安装过程需要一些时间。

步骤6 —选择选项 (Step 6 — Select Options)

Once installation is complete, you’ll receive the following output:

安装完成后,您将收到以下输出:


   
   
Output
... installation finished. Do you wish the installer to prepend the Anaconda3 install location to PATH in your /home/sammy/.bashrc ? [yes|no] [no] >>>

It is recommended that you type yes to use the conda command.

建议您键入yes以使用conda命令。

步骤7 —激活安装 (Step 7 — Activate Installation)

You can now activate the installation with the following command:

现在,您可以使用以下命令激活安装:

  • source ~/.bashrc

    来源〜/ .bashrc

步骤8 —测试安装 (Step 8 — Test Installation)

Use the conda command to test the installation and activation:

使用conda命令测试安装和激活:

  • conda list

    conda清单

You’ll receive output of all the packages you have available through the Anaconda installation.

您将收到通过Anaconda安装可获得的所有软件包的输出。

第9步-设置Anaconda环境 (Step 9 — Set Up Anaconda Environments)

You can create Anaconda environments with the conda create command. For example, a Python 3 environment named my_env can be created with the following command:

您可以使用conda create命令创建Anaconda环境。 例如,可以使用以下命令创建名为my_env的Python 3环境:

  • conda create --name my_env python=3

    conda创建--name my_env python = 3

Activate the new environment like so:

像这样激活新环境:

  • conda activate my_env

    conda激活my_env

Your command prompt prefix will change to reflect that you are in an active Anaconda environment, and you are now ready to begin work on a project.

您的命令提示符前缀将更改,以反映您处于活动的Anaconda环境中,并且您现在准备开始进行项目工作。

翻译自: https://www.digitalocean.com/community/tutorials/how-to-install-anaconda-on-ubuntu-18-04-quickstart

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值