译:在 CentOS 7上安装Anaconda

原文(英文)网址为:https://linuxhint.com/install-anaconda-centos7/

The original (English) URL is: https://linuxhint.com/install-anaconda-centos7/

Anaconda Python is a distribution of Python which provides many tools for data scientists. These tools are also Python packages. You can install them manually on Python. But Anaconda Python includes them by default.  In this article, I will show you how to install Anaconda Python on CentOS 7. Let’s get started.

Anaconda Python是 Python 的一个开发环境, 它为数据科学家提供了许多工具。 这些工具也是 Python 软件包。 你可以在 Python 上手动安装它们。 但是Anaconda Python默认包含它们。 在本文中, 我将向您展示如何在 CentOS 7上安装Anaconda Python。 我们开始吧。

译:在 CentOS 7上安装Anaconda_第1张图片

Downloading Anaconda Python:

下载Anaconda Python:

In this section, I am going to show you how to download Anaconda Python for CentOS 7.

在本节中, 我将向您展示如何为 CentOS 7下载 Anaconda Python。

First, go to https://www.anaconda.com the official website of Anaconda Python.

首先, 访问 https://www.Anaconda.com, 官方网站 Anaconda Python。

译:在 CentOS 7上安装Anaconda_第2张图片

Click on the green “Download” button on the top right corner of the page. You should see the following page.

点击页面右上角的绿色"下载"按钮。 你应该看看下面这一页。

译:在 CentOS 7上安装Anaconda_第3张图片

Now scroll down a little bit and you should see the following section. Make sure “Linux” is selected. Now click on “Download” to download Anaconda Python. You may select Python 2.7 or Python 3.6 depending on your requirements. If you’re unsure, select Python 3.6.

现在向下滚动一点, 你应该看到下面的部分。 确保选择"Linux"。 现在点击"下载"下载Anaconda Python。 您可以根据需求选择 python2.7或 python3.6。 如果你不确定, 选择 python3.6。

译:在 CentOS 7上安装Anaconda_第4张图片

The browser should prompt you to save the file. Click on “Save File” and click on “OK”. The download should start. It’s a pretty big file. So it may take a while for the download to complete.

浏览器应该会提示您保存文件。 点击「储存档案」 , 然后按「确定」。 下载应该开始了。 这是一个相当大的文件。 所以下载完成可能需要一段时间。

译:在 CentOS 7上安装Anaconda_第5张图片


Verifying the Downloaded file:

验证下载文件:

In this section, I am going to show you how to verify the integrity of the downloaded file.

在本节中, 我将向您展示如何验证下载文件的完整性。

This is very important. Because if we try to install a software from a corrupted file, the installation may not work properly. It is also a security risk to not verify the integrity of the file. If a checksum is given in the website of the software that we are downloading, we should check it. Since Anaconda Python do provide these, I think it’s best to take advantages of it.

这是非常重要的。 因为如果我们试图从损坏的文件中安装一个软件, 那么安装可能不会正常工作。 不验证文件的完整性也是一种安全风险。 如果在我们正在下载的软件的网站上给出了一个校验, 我们应该检查一下。 由于Anaconda Python提供了这些, 我认为最好利用它。

Once the download is complete, go to the directory where you downloaded the file. In my case it is the Downloads directory on my HOME directory.

一旦下载完成, 请到下载文件的目录。 在我的例子中, 它是我的 HOME 目录下的 Downloads 目录。

Run the following command to change the directory to HOME/Downloads:

运行以下命令将目录更改为 home / downloads:

cd ~/Downloads

Now if I list the contents of the ~/Downloads directory, you can see that Anaconda Python’s installation file is there. At the time of this writing, the installation file is ‘Anaconda3-5.0.1-Linux-x86_64.sh’.

现在, 如果我列出 ~ / Downloads 目录的内容, 你可以看到 Anaconda Python 的安装文件在那里。 在编写本文时, 安装文件是 anaconda3-5.0.1-linux-x86_64.sh文件。

Now run the following command to generate a SHA256 hash of the downloaded file:

现在运行以下命令生成一个 SHA256哈希的下载文件:

$ sha256sum Anaconda3-5.0.1-Linux-x86_64.sh

You should see something like this:

你应该看看这样的东西:

译:在 CentOS 7上安装Anaconda_第6张图片

Now copy the hash as shown in the screenshot.

现在复制屏幕截图中显示的哈希值。

Go to https://docs.anaconda.com/anaconda/install/hashes/all from any browser of your choice. You should see the following page. This page contains the hashes of all versions of Anaconda Python ever released. This page is trusted because it is in the official documentation of Anaconda Python.

访问 https: / / docs.anaconda.com / anaconda / install / hashes / all from any browser of your choice。 你应该看看下面这一页。 这个页面包含了所有版本的Anaconda Python的 hash 曾经发布。 这个页面是可信的, 因为它是在 Anaconda Python 的官方文档中。

译:在 CentOS 7上安装Anaconda_第7张图片

The easy way to verify the hash is to copy the hash we generated earlier and search for it in this page. If a match is found, the hash is correct, otherwise it is not.

验证哈希值的简单方法是复制我们之前生成的哈希值并在此页中搜索它。 如果找到匹配, 哈希就是正确的, 否则就不是。

Now press Ctrl+F to bring the search bar. You can see that the search bar is at the bottom of the screen.

现在按 Ctrl + f 带上搜索栏。 你可以看到搜索栏在屏幕的底部。

译:在 CentOS 7上安装Anaconda_第8张图片

Now paste the hash we generated earlier in the box. You can see that a match was found as marked green in the screenshot. So the downloaded file is ok.

现在粘贴我们之前在盒子里生成的散列。 你可以看到在截图中发现一个标记为绿色的匹配。 所以下载的文件是可以的。

译:在 CentOS 7上安装Anaconda_第9张图片


Installing Anaconda Python:

安装蟒蛇:

At this point, we are ready to install Anaconda Python. Open a terminal and go to the directory where you downloaded Anaconda Python.

在这一点上, 我们准备安装蟒蛇。 打开终端, 然后到你下载蟒蛇的目录。

Run the following command to change to the Downloads directory:

运行下面的命令来更改到 Downloads 目录:

$ cd ~/Downloads

Now run the following command to start the installer:

现在运行以下命令来启动安装程序:

bash Anaconda3-5.0.1-Linux-x86_64.sh

You should see the following window:

你应该看看下面的窗口:

译:在 CentOS 7上安装Anaconda_第10张图片

Press to continue the installation. Once you press , you should see the following window. This is the license agreement of Anaconda Python. Read through the license agreement by pressing or .

按回车继续安装。 一旦按下回车键, 应该会看到下面的窗口。 这是蟒蛇的许可协议。 通过按下回车键或空格键读取许可协议。

Once you’re at the end of the license agreement, type ‘yes’ and press to continue.

一旦你在许可协议的末尾, 键入'是'并按回车继续。

译:在 CentOS 7上安装Anaconda_第11张图片

Now Anaconda Python should ask you for the directory where Anaconda Python will be installed. The default is /home/YOUR_USER/anaconda3. If you wish, you can change it. But I will leave the default. Once you’re done, press to continue.

现在 Anaconda Python 应该问你安装 Anaconda Python 的目录。 默认值是 / home / your user / anaconda3。 如果你愿意, 你可以改变它。 但我会保留默认值。 完成后, 按回车键继续。

译:在 CentOS 7上安装Anaconda_第12张图片

The installation of Anaconda Python should start. It may take a while to install, as the installation file is pretty big.

应该开始安装Anaconda Python。 安装可能需要一段时间, 因为安装文件相当大。

译:在 CentOS 7上安装Anaconda_第13张图片

At the end of the installation, Anaconda Python installer may ask you whether to add Anaconda Python to the PATH variable of CentOS 7. That way you can execute anaconda python without specifying the full installation path. Most of the people would want this. So type ‘yes’ and press to continue.

在安装结束时, Anaconda Python 安装程序可能会问你是否要在 CentOS 7的 PATH 变量中添加 Anaconda Python。 这样你就可以在不指定完整的安装路径的情况下执行蟒蛇。 大多数人都希望这样。 所以输入'yes'然后按回车继续。

译:在 CentOS 7上安装Anaconda_第14张图片

Once the installation is complete, you should see something like this.

一旦安装完成, 你应该会看到类似的东西。

译:在 CentOS 7上安装Anaconda_第15张图片


Verifying the installation:

验证安装:

Now open a new Terminal and run the following commands to verify whether Anaconda Python was installed correctly.

现在打开一个新的终端并运行以下命令来验证 Anaconda Python 是否正确安装。

$ conda --version

So that’s how you install Anaconda Python on CentOS 7. Thanks for reading this article.

这就是你在 CentOS 7上安装Anaconda Python的方法。 谢谢你读了这篇文章。

你可能感兴趣的:(Linux,anaconda)