Anaconda is an Open-Source distribution for Python & R programming languages. It is being used widely for Machine Learning, Data Science etc. It has more than 1500 python/R data packages & is an industry-standard for developing, testing, and training on a single machine.
Recommended Read: Simple guide to install POSTGRESQL on Ubuntu
Also Read: Complete guide to install Anaconda in CentOS
With anaconda’s conda, we can manage dependencies, libraries & environments. We can also use it with a number of applications like TensorFlow, Dask, Numba, Boken, Datashader etc to develop and train machine learning and deep learning models or analyze data with scalability and performance or to visualize results.
In this tutorial, we will learn to install Anaconda on Ubuntu. Let’s start out with pre-requisites first.
Pre-requisites
Before we can install Anaconda on Ubuntu, we need to make sure that the following packages are installed or not,
$ sudo apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
You must also ensure that Python is installed on your system, which in most of the cases its installed but you can also install it on your system with the following command,
$ sudo apt-get install python
You can also refer to this detailed tutorial on installing Python on Ubuntu or installing Python from the source. After installing these packages, we can move to the installation part.
Install Anaconda on Ubuntu
For anaconda installation, we need to download the latest installation script available on the following URL. You can also use the following command to download the script on your system,
$ wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
This script is for python 3.7, so make sure that you have that installed. There is also an installation script for python 2.7 but I recommend not to use that since Python 2.7 is no longer being supported but you can use that also if you want.
The script is about 500 Mb in size & will take some to complete. Once the script has been downloaded, we need to run the script to install anaconda on Ubunutu,
$ bash Anaconda3-2019.10-Linux-x86_64.sh
Now follow the on-screen instructions to install anaconda, basically, we need to press ‘enter’ only till the script completes.
In the end, you will be asked questions like “License Agreement”, “Installation Path ”, “Installer adding PATH variable for anaconda on .bashrc fie”. You need to provide input for all these, upon completion of these questions, Anaconda will be installed on the system.
Now we can either log out & log back in or use the following command to activate the installation,
$ source ~/.bashrc
Now either we can use GUI tool called Anaconda Navigator to use conda or we can also use the cli commands for conda to manage the packages. We can start anaconda navigator from the menu or by entering the following command in the terminal,
$ anaconda-navigator
Let’s also discuss some CLI commands for Conda.
Conda Commands
Install a package
To install a package using conda, the command is
$ conda install package_name
Update a package
To update a package, use
$ conda update package_name
Remove a package
To remove a package name, use
$ conda remove package_name
You can also refer to a detailed cheat sheet for Condo Commands. This completes our tutorial, please do let us know if you have any questions, queries or suggestions using the comment box below.