How to Install Anaconda Python on Ubuntu 18.04 LTS

29/12/2020
Anaconda Python is a Python distribution just like Ubuntu is a Linux distribution. Anaconda Python comes pre-installed with all the data science and machine learning tools. That’s why it’s great for people interested in those.   In this article, I will show you how to install Anaconda Python on Ubuntu 18.04 LTS. Let’s get started.

Downloading Anaconda Python:

Anaconda Python is not available in the official package repository of Ubuntu 18.04 LTS. But it can be downloaded from the official website of Anaconda Python.

To download Anaconda Python, first visit https://www.anaconda.com/download/#linux from any web browser of your choice and you should see the following page.

As you can see from the screenshot below, Anaconda Python is available for Python 3.6 and Python 2.7. In this article, I am going to show you how to download and install Anaconda Python for Python 3.6. The process is similar for Anaconda Python for Python 2.7.

Click on the Download button to download Anaconda Python for Python 3.6.

Now click on Save File and then click on OK.

Your download should start.

Installing Anaconda Python:

Now that Anaconda Python is downloaded, you can install it on your Ubuntu 18.04 LTS computer. I am going to show you how in this section.

First open up a Terminal and navigate to the ~/Downloads/ directory in your user’s HOME directory where you downloaded Anaconda Python with the following command:

$ cd ~/Downloads

If you list the contents of the ~/Downloads/ directory, you should see the Anaconda Python installer as you can see in the marked section of the screenshot below.

$ ls -lh

NOTE: By default, Anaconda Python will be installed on the ~/anaconda3 or ~/anaconda2 directory in your user’s HOME directory depending on which Python version of Anaconda Python you are trying to install. If you don’t have any problem with that, you can run the Anaconda Python installer without sudo or super user privileges. But if you want to install it somewhere else such as /usr/local/anaconda3 or /usr/local/anaconda2, or /opt/anaconda3 or /opt/anaconda2, then you must run the Anaconda Python installer with sudo or super user privileges and configure the PATH of your computer manually.

Now to install Anaconda Python, run the following command:

$ bash Anaconda3*.sh

Now press <Enter>.

Now press the <Space Bar> several times to go to the end of the License Agreement.

Once you see the following prompt, type in yes and then press <Enter> to continue.

Now you should see the following prompt. Here you put a directory path where you want Anaconda Python to be installed. By default, it is the ~/anaconda3 or ~/anaconda2 directory in your user’s HOME directory. But you can change that. I am going with the default. Just press <Enter>.

The installation should start.

Once the installation is complete, the installer should ask you whether you want to add Anaconda Python to the PATH of your Ubuntu 18.04 LTS. Type in yes and press <Enter>.

The installation and configuration is complete.

Recently Microsoft and Anaconda has joined up. So Anaconda Python installer asks whether you want to install the Microsoft’s free code editor Visual Studio Code. I will just say no as I don’t want to install Visual Studio Code.

Testing Anaconda Python:

Now that Anaconda Python is installed, you can open a new terminal and type in the following command to check whether Anaconda Python is added to the PATH of your Ubuntu 18.04 LTS operating system.

$ echo $PATH

As you can see from the marked section of the screenshot below, the Anaconda Python is on the PATH.

To check whether Anaconda Python is working, run the following command:

$ conda –version

As you can see, Anaconda Python is working correctly.

Installing New Packages of Anaconda Python:

Anaconda Python comes with a lot of packages pre-installed. But it you need some other packages, you can install it very easily with conda command.

You can find a list of all the packages available on Anaconda Python at https://docs.anaconda.com/anaconda/packages/pkg-docs

Click on your Anaconda Python version and operating system from the page. I installed Anaconda Python 64-bit for Python 3.6, so I clicked on the marked link 64-bit Linux, Py3.6.

You should see a table as shown in the screenshot below. The table contains 4 columns. The Name column contains the package name. The Version column holds the package version, Summary/License column holds a short description of the package and the In Installer column has marks that indicates whether the package is included in the Anaconda Python installer. If a tick mark is present, it means the package is already installed, so you don’t have to install it manually after installing Anaconda Python.

Now to install an Anaconda Python package, let’s say gitpython, run the following command:

$ conda install gitpython

Now press y and then press <Enter> to continue.

The gitpython package should be installed.

Removing an Anaconda Python Packages:

You can list all the installed Anaconda Python package with the following command:

$ conda list

To remove an Anaconda Python package, let’s say the gitpython package I just installed, run the following command:

$ conda remove gitpython

Press y and then press <Enter> to continue.

The gitpython package should be removed.

So that’s how you install Anaconda Python and manage Anaconda Python packages. Thanks for reading this article.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

Sentiment Analysis with TextBlob and Python

In this lesson, we will use one of the excellent Python package – TextBlob, to build a simple sentimental analyser....
29/12/2020

Python inotify examples

If you are involved in the world of technology even slightly, you will definitely have heard of the programming language...
29/12/2020

Python Command Line Parsing Tutorial

Parsing is a process of analysing a series of texts to find out what the program is supposed to do with the given commands....
29/12/2020
Bài Viết

Bài Viết Mới Cập Nhật

Mua Proxy V6 Nuôi Facebook Spam Hiệu Quả Tại Onetcomvn
03/06/2024

Hướng dẫn cách sử dụng ProxyDroid để duyệt web ẩn danh
03/06/2024

Mua proxy Onet uy tín tại Onet.com.vn
03/06/2024

Thuê mua IPv4 giá rẻ, tốc độ nhanh, uy tín #1
28/05/2024

Thuê địa chỉ IPv4 IPv6 trọn gói ở đâu chất lượng, giá RẺ nhất?
27/05/2024