Introduction
Anaconda is an open-source package manager and framework for handling machine learning and data science workflows. It also helps to distribute some programming languages like Python and R. With over 7500 different scientific data packages, Anaconda helps process large-scale data, scientific computing, and predictive analysis. This package is available as a free and paid version.
In this tutorial, we will be looking at how to install Anaconda on Ubuntu 18.04, activate and test installation, and set up Anaconda environments.
Are you ready? Let’s start!
Step 1: Download Anaconda
First, we need to download the latest stable version of Anaconda. Go to the Anaconda download page using this link https://www.anaconda.com/distribution/ to retrieve the latest version of Anaconda. After that, go to your server as a sudo non-root user and change to /tmp directory to download the Anaconda bash script. Next, download the link you copied earlier from the Anaconda website using curl:
1 2 |
cd /tmp curl -O https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh |
Step 2: Check the Integrity of the Installer Data
The next step is to check the integrity of the installer data with the hash encryption check, using the command:
1 |
sha256sum Anaconda3-2020.07-Linux-x86_64.sh |
You will see an output similar to this once you run the command:
1 |
95c851b7497cc14d5ca060064394569f724b67d9b5f98a926ed49b834a6bb73a Anaconda3-2019.03-Linux-x86_ |
Next, you need to check if your output is part of the hashes available on the Anaconda documentation page. You can go to the next step if it is the same as the hash on this page. However, if you went with another version, check the documentation to verify that version checksum.
Step 3: Run the Script
Then, go ahead and run the script using this command:
1 |
bash Anaconda3-2020.07-Linux-x86_64.sh |
You should see an output similar to this once you run the command:
Output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
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] |
After that, select the ENTER button to continue and then click ENTER to read the license terms. You will be asked to approve these terms:
If you agree to the terms, write yes.
Step 4: Finalize the Installation Process
Now, you will be asked to choose the perfect location for installation. Press ENTER to accept the default location or select a different location you want to include. You will see an output similar to this if you have followed this guide closely:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
Output: Anaconda3 will now be installed into this location: /home/user-name/anaconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below [/home/user-name/anaconda3] >>> |
The Anaconda installation will now resume. You should bear in mind that the process will take some time to complete.
Note: User-location represents the default location or the location you chose in the installation process above.
You will see an output like this on successful completion of the installation:
1 2 3 4 5 6 7 8 9 10 11 |
Output ... installation finished. Do you wish the installer to prepend the Anaconda3 install location to PATH in your /home/user-location/.bashrc ? [yes|no] [no] >>> Enter yes to allow the use of a conda command. |
Step 5: Activate and Test Installation
To activate the installation, type the following command:
1 |
source ~/.bashrc |
To test the installation, type the conda command below:
1 |
conda list |
The system will display all the available packages via the Anaconda installation.
It will display something similar to this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
active environment : None user config file : /home/user/.condarc populated config files : conda version : 4.5.4 conda-build version : 3.10.5 python version : 3.7.0.final.0 base environment : /home/user/anaconda3 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/free/linux-64 https://repo.anaconda.com/pkgs/free/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/pro/linux-64 https://repo.anaconda.com/pkgs/pro/noarch package cache : /home/user/anaconda3/pkgs /home/user/.conda/pkgs envs directories : /home/user/anaconda3/envs /home/user/.conda/envs platform : linux-64 user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.5 Linux/4.15.0-22-generic ubuntu/18.04 glibc/2.27 UID:GID : 1000:1000 netrc file : None offline mode : False |
Step 6: Set Up Anaconda Environments
To set up Anaconda environments, you will make use of the conda command. For example, to create a Python 3 environment named user_environment, type the following command:
1 |
conda create --name user_environment python=3 |
Next, activate the new environment using this command:
1 |
conda activate user_environment |
The command prompt will change to show that you are in an active Anaconda environment. You can now work in this environment.
Conclusion
We have come to the end of this tutorial. By now, you should know how to install Anaconda using the conda command utility to set up Anaconda environments, download the latest Anaconda version, verifying the data integrity of the installer, and activate and test installation.
Happy Computing!
- Removing Spaces in Python - March 24, 2023
- Is Kubernetes Right for Me? Choosing the Best Deployment Platform for your Business - March 10, 2023
- Cloud Provider of tomorrow - March 6, 2023
- SOLID: The First 5 Principles of Object-Oriented Design? - March 3, 2023
- Setting Up CSS and HTML for Your Website: A Tutorial - October 28, 2022