Setting Up Anaconda on Ubuntu or Debian: A Comprehensive Guide

Setting Up Anaconda on Ubuntu or Debian: A Comprehensive Guide

08:15, 25.10.2023

Article Content
arrow

  • Main Benefits of Using Anaconda
  • Installing Anaconda on Ubuntu 22.04
  • Step 1. Download Anaconda
  • Step 2. Open the terminal application 
  • Step 3. Log in to your VPS 
  • Step 4. Find the Anaconda installer
  • Step 5. Run the installation script 
  • Step 6. Complete the installation prompts
  • Step 7. Initialize Anaconda
  • Step 8. Verify the installation.
  • Step 9. Create a new Anaconda environment 
  • Step 10. Install the necessary packages
  • Step 11. Deactivate the environment (optional)
  • Uninstalling Anaconda from Ubuntu 22.04: Step-by-Step Guide
  • Step 1. Open the terminal
  • Step 2. Deactivate Anaconda environments.
  • Step 3. Uninstall Anaconda
  • Step 4. Remove Anaconda from your shell
  • Step 5. Remove Anaconda files
  • Step 6. Verify the uninstallation
  • Wrapping Up
  • FAQ
  • Is it possible to have both Anaconda and the system-installed Python on Ubuntu 22.04?
  • What is the process for creating a new environment within Anaconda on Ubuntu 22.04?
  • How can I activate an Anaconda environment on Ubuntu 22.04?
  • What is the method for installing packages in Anaconda on Ubuntu 22.04?
  • Is it feasible to utilize pip along with Anaconda on Ubuntu 22.04?
  • How can I determine the version of Anaconda installed on Ubuntu 22.04?

Anaconda is a popular open-source distro of Python and R programming languages that is highly praised both by beginner users and by users involved in data science as well as other scientific branches. The solution is cross-platform, so you can have it either on Linux, Windows, or Mac.

Today we want to provide you with a comprehensive guide on how to install Anaconda on your Ubuntu or Debian VPS.

Main Benefits of Using Anaconda

Before we move on to the installation process, let’s have a brief overlook of the advantages you can enjoy in case you opt for Anaconda.

  • Package Management: Anaconda provides its users with its own powerful package manager known as Conda. The package manager is very helpful when it comes to installing, updating, and managing libraries and dependencies. The package manager provides that diverse packages and versions do not conflict one with another, making setting up and maintaining software environments considerably easier.
  • Environment Management: Another feature of Anaconda is its ability to create isolated environments for separate projects or tasks. In other words, each environment may have its version of Python as well as packages whereby version conflicts will be avoided.
  • Pre-Built Libraries: Anaconda comes with lots of pre-built data science and machine learning libraries preinstalled, including NumPy, pandas, scikit-learn, TensorFlow, and PyTorch. The libraries show a high degree of optimization and compatibility.
  • Ecosystem Integration: Anaconda integrates with popular data science tools like Jupyter Notebook, JupyterLab, and RStudio which makes it especially convenient and helpful for data scientists.
  • Scalability: Anaconda proves to be flexibly applicable for projects of different scales.
  • Community and Support: Anaconda enjoys a large community of users and developers, who are actively engaged in the project, helping and supporting each other.
  • Data Visualization: Among other things Anaconda offers potent visualization libraries, including Matplotlib, Seaborn, and Plotly, that are good at creating compelling visualizations to communicate the information in a transparent and clear way.
  • Data Management: Anaconda will let you manage your data efficiently through various tools for data manipulation and storage.
  • Conda-forge: Being an Anaconda user, you can get access to the so-called conda-forge channel, which contains a large number of community-maintained packages. This way you can get even more than it’s supposed to be in the original Anaconda distro.
  • Security: Anaconda offers regular updates for your data science projects to always remain secure.
  • Commercial and Enterprise Versions: If you want to enjoy even more features of Anaconda for projects of a huge scale, you can especially opt for Anaconda’s Enterprise version.

Installing Anaconda on Ubuntu 22.04

Step 1. Download Anaconda

Download Anaconda or Miniconda depending on what your requirements are.

Step 2. Open the terminal application 

You can do this either with the Ctrl+Alt+T combination or you can find it in the applications menu.

Step 3. Log in to your VPS 

Log in to your VPS as root through SSH. Update the system through APT.

sudo apt update

Step 4. Find the Anaconda installer

Navigate to the directory that now contains the Anaconda installation program. If it’s in the “Downloads” folder then go to this folder:

cd ~/Downloads

Step 5. Run the installation script 

Run the installation script by running the following command:

bash Anaconda3-2021.05-Linux-x86_64.sh

(Anaconda3-2021.05-Linux-x86_64.sh should be replaced with the name of the file you downloaded).

Step 6. Complete the installation prompts

Go through the installation procedure by following the prompts.

Step 7. Initialize Anaconda

After the installation has finished, initialize Anaconda:

source ~/.bashrc

After that, the shell will be able to recognize commands for Anaconda.

Step 8. Verify the installation.

You can check whether everything has gone correctly this way:

conda --version

You should see the version of Conda.

Step 9. Create a new Anaconda environment 

This way you can establish work on several projects simultaneously. Use the following formula:

conda create --name myenv python=x.x

myenv should be replaced by the name of your environment and x.x with the Pything version.

Step 10. Install the necessary packages

Install the packages you need. Use conda to do it together with the name of your desired package:

conda install numpy

Step 11. Deactivate the environment (optional)

After finishing working with an Anaconda environmant, you may turn it off:

conda deactivate myenv

Uninstalling Anaconda from Ubuntu 22.04: Step-by-Step Guide

If you don’t need Anaconda for your projects anymore, you can also remove it from your system.

Step 1. Open the terminal

Open the terminal with the Ctrl+Alt+T keyboard shortcut or through your apps menu.

Step 2. Deactivate Anaconda environments.

Before you start uninstalling Anaconda from your system, it’s a good thing to do to deactivate all Anaconda environments first.

conda deactivate

Step 3. Uninstall Anaconda

Perform the uninstallation procedure. For this, you’ll need the Anaconda installer and apply the -uninstall option. To to the path where you installed Anaconda and execute such a script:

bash ~/anaconda3/uninstall-Anaconda3.sh

Step 4. Remove Anaconda from your shell

Although the previously described script performs Anaconda’s uninstallation, your system will still contain some traces of it, in particular, Anaconda-related lines in your shell configuration files (.bashrc, .zshrc, .profile, and so on). To do it you’ll need a text editor. For example, Nano. Let’s open .bashrc in it:

nano ~/.bashrc

Find the lines that have to do with Anaconda or Conda. Delete them, save the file, and exit the editor.

Step 5. Remove Anaconda files

Remove the remaining files related to Anaconda with the rm command. Keep in mind that this command deletes files and directories once and for all.

rm -rf ~/anaconda3

If you had Anaconda in a different folder, specify the corresponding location.

Step 6. Verify the uninstallation

To check that Anaconda is no longer present on your device, you can use the conda command:

conda --version

If the system doesn't recognize it, Anaconda is uninstalled.

Wrapping Up

Anaconda is a popular Python distribution that is pretty easy to use, which makes it popular amongst novice users. At the same time has a variety of features that will make it useful for data scientists and other scientists that have to do with data. It also enjoys a larger community, so by choosing it, you’ll certainly have a comfortable user experience. We hope that this guide was sufficient for you to understand all aspects of Anaconda’s installation. Thank you for your attention, stay tuned!

FAQ

Is it possible to have both Anaconda and the system-installed Python on Ubuntu 22.04?

Yes, it’s possible. Since Anaconda allows you to have multiple isolated Python environments, one can have different Python installations and use them independently.

What is the process for creating a new environment within Anaconda on Ubuntu 22.04?

To create an environment on Anaconda use conda create, like this:

conda create --name myenv python=x.x

myenv is the name of your environment and x.x is the Python version.

How can I activate an Anaconda environment on Ubuntu 22.04?

To activate an Anaconda environment on Ubuntu 22.04 use:

conda activate myenv

What is the method for installing packages in Anaconda on Ubuntu 22.04?

Use conda to install packages: 

conda install package_name

Is it feasible to utilize pip along with Anaconda on Ubuntu 22.04?

Yes, you can use pip interchangeable with conda for package installation.

How can I determine the version of Anaconda installed on Ubuntu 22.04?

To figure out, which version of Anaconda is installed on your Ubuntu 22.04, use:

conda --version

views 6m
views 2
Share

Was this article helpful to you?

VPS popular offers

Other articles on this topic

Backup VPS
Backup VPS
cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.