Anaconda is a popular Python / R data engine and machine learning platform, used for large-scale data processing, predictive analytics and scientific computing.
Anaconda distribution is shipped with 250 open source data packages, and more than 7,500 additional packages can be installed from Anaconda repositories. It also includes a conda command line tool and a desktop graphical user interface called Anaconda Navigator.
This tutorial will walk you through installing Anaconda Python Distribution on Ubuntu 20.04.
At the time of writing this article, the latest stable version of Anaconda is version 2020.02. Before downloading the installer script, visit the Downloads page and check if there is a new version of Anaconda for Python 3 available for download.
Complete the following steps to install Anaconda on Ubuntu 20.04:
1. Anaconda Navigator is a QT based GUI. If you installed Anaconda on a desktop machine and you want to use the GUI application, install the following package. If not, skip this step.
sudo apt install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
2. Download the Anaconda installation script with your web browser or wget:
wget -P /tmp https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
Downloading may take a long time depending on your connection speed.
3. This step is optional, but it is recommended to verify the integrity of the script data.
Use the sha256 command to display the checksum script:
The output will look like this:
Make sure the hash printed from the command above matches what is available in Anaconda in Python 3 on a 64-bit Linux page for the appropriate version of Anaconda.
4. Run the script to start the installation process:
You will see an output like the following:
Welcome to Anaconda3 2020.02 In order to continue the installation process, please review the license agreement. Please, press ENTER to continue >>>
Press ENTER to continue. To scroll through the licenses, use the ENTER key. After completing reviewing the license, you will be asked to agree to the license terms:
Do you approve the license terms? [yes|no]
Type yes to accept the license, and you will be asked to choose the installation location:
Anaconda3 will now be installed into this location: /home/installworld/anaconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below
The default location must be good for most users. Press ENTER to confirm location.
The installation might take a while, and after it’s finished, the script will ask if you want to run conda init. Type yes.
Installation finished. Do you wish the installer to initialize Anaconda3 by running conda init? [yes|no]
This will add a command line tool to your system’s PATH.
To enable Anaconda installation, you can close and reopen your shell or load a new PATH environment variable into the current shell session by typing:
To verify the type of installation in your terminal.
There she is! You have successfully installed Anaconda on your Ubuntu machine, and you can start using it.
If you installed Anaconda on a Desktop system, open the Navigator GUI by entering anaconda-navigator in your terminal:
Updating Anaconda is a very easy process. Open your terminal and enter:
conda update --all
If there is an update, conde will display a list and ask you to confirm the update:
The following packages will be UPDATED: anaconda-navigator 1.9.12-py37_0 --> 1.9.12-py37_1 conda 4.8.2-py37_0 --> 4.8.3-py37_0 conda-package-han~ 1.6.0-py37h7b6447c_0 --> 1.6.1-py37h7b6447c_0 Proceed ([y]/n)?
It’s a good idea to update your Anaconda installation regularly.
If you want to delete Anaconda from your Ubuntu system, delete the Anaconda installation directory and all other files that were created during installation:
rm -rf ~/anaconda3 ~/.condarc ~/.conda ~/.continuum
Open the ~ / .bashrc file and delete the Anaconda directory from the PATH environment variable:
# >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/home/installworld/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/home/installworld/anaconda3/etc/profile.d/conda.sh" ]; then . "/home/installworld/anaconda3/etc/profile.d/conda.sh" else export PATH="/home/installworld/anaconda3/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<<
We have shown you how to install Anaconda on Ubuntu 20.04. You should now check the official Getting started with Conda guide.
If you experience problems or get feedback, leave a comment below.