In this tutorial, we will show you how to install Anaconda Python on a Debian 9 VPS.
Anaconda is one of the most popular package managers and distribution systems for the Python and R programming languages. It is open-source and designed for data science and machine learning platforms, and is used for large-scale data processing, deep learning-related applications, and scientific computing.
Anaconda Distribution is used by over 15 million users and it offers more than 1400 data packages individually from its repository. Anaconda python also includes an environment manager and a package manager called ‘conda’. It works on all major operating systems, including Linux, macOS, and Windows.
Let’s begin with the installation.
Table of Contents
Prerequisites
- For the purposes of this tutorial, we will use a Debian 9 VPS.
- Full SSH root access or a user with sudo privileges is also required.
Step 1: Connect via SSH and Update the OS
Connect to your server via SSH as the root user using the following command:
Remember to replace “IP_ADDRESS” and “PORT_NUMBER” with your server’s respective IP address and SSH port number.
Before starting with the installation, you will need to update your OS packages to their latest versions. It’s easy to do, and it won’t take more than a few minutes.
You can do this by running the following command:
Once the updates are completed, we can move on to the next step.
Step 2: Install Anaconda
The current latest stable version for Anaconda is 2019.07 at the time of writing this tutorial. You can check if the new version is available by visiting the Anaconda download page at the Anaconda website.
Change to the /opt
directory and download the Anaconda installation script with the following command:
Once the script is downloaded, use the sha256sum
command to verify the script checksum as shown below:
The output will look similar to bellow:
Make it sure above hash matches with hash available at the “Anaconda with Python 3 on 64 bit Linux” webpage: https://docs.anaconda.com/anaconda/install/hashes/Anaconda3-2019.07-Linux-x86_64.sh-hash/
If the hashes match, you can continue with the Anaconda Python installation.
To start the Anaconda installation process run the installation script:
You should see an output like the following:
Press ENTER to continue and then press ENTER to scroll through the license. Once you’re done reviewing the license, you’ll be asked to accept the license terms:
Type yes and hit ENTER, and you will be prompted to accept the default Anaconda installation path:
Press ENTER to confirm the default location /root/anaconda3
and the Anaconda installation will start, which may take some time, depending on your server resources. And once it is completed, the following output will be displayed:
We will type “yes” so that we can use the conda
command. You will get an output similar to the one below:
Next, source the ~/.bashrc
file to activate your Anaconda installation with the following command:
We can now verify our Anaconda installation by running the following command:
The output below shows the conda version:
We can also verify the basic Anaconda installation information using the following command:
The output should look like this:
Step 3: Upgrade Anaconda
You need to regularly update Anaconda to the latest version. In order to upgrade Anaconda, we need to upgrade the conda tool with the following command:
We will be asked to accept the update, so we have to type “y” and hit ENTER to update conda. Once the conda utility is updated, we can proceed with Anaconda update by running the following command:
We will be asked to accept the update, so type “y” and hit ENTER to update Anaconda.
Step 4: Set Up an Anaconda Environment
Anaconda virtual environments is a working copy of Python that maintains its own files, directories, and paths so that we can work with specific versions of libraries or Python.
For example, to create a Python 3 environment named new_env
, run the following command:
Once created, activate the new environment with the following command:
Once activated, we are now ready to begin work on a project.
Congratulations. We have successfully installed Anaconda Python on our Debian 9 VPS. For more information about Anaconda Python, visit the official documentation page at Anaconda website.
Of course, you don’t have to install Anaconda Python on Debian 9 if you use one of our Python VPS Hosting solutions, in which case you can simply ask our expert Linux admins to install Anaconda Python on Debian 9 for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post on how to install Anaconda Python on Debian 9, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.
Amazing Editorial!!
I appreciate the fact that you have explained all the information in depth.
Well researched & well-listed posts, especially those who didn’t know how to install Anaconda Python on Debian 9, they will get support for sure. Keep focusing on such topics.