Install Anaconda Python on Debian 12 Bookworm

In this guide, you will learn to Install Anaconda Python on Debian 12 Bookworm from Command-Line. Anaconda is a package manager that is commonly used for machine learning and artificial intelligence applications. It provides libraries and dependencies in Python programming language. You can follow this tutorial to start your Anaconda installation on Debian 12.

How To Install Anaconda Python on Debian 12 Bookworm?

You must have access to your server as a non-root user with sudo privileges before you start your Anaconda installation. To do this, you can follow this guide on Initial Server Setup with Debian 12 Bookworm.

Now proceed to the following steps to complete this guide.

Step 1 – Download Anaconda Python Installer on Debian 12

First, you must run the system update from your terminal with the command below:

sudo apt update

Then, you must visit the Anaconda Downloads page and get the latest Python installer for Linux.

Download Anaconda Python installer

You need to switch to your /tmp directory and use the following wget command to download the Anaconda Python installer:

# cd /tmp
# sudo wget https://repo.anaconda.com/archive/Anaconda3-2023.07-2-Linux-x86_64.sh

Step 2 – Run Anaconda Python Installer

When your download is completed, you can run your Anaconda installer on Debian 12 with the command below:

bash Anaconda3-2023.07-2-Linux-x86_64.sh

When you run the installer, you will see the following output:

Output

Welcome to Anaconda3 2023.07

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>

Press Enter to continue. And Press Yes to accept the license agreement.

Do you accept the license terms? [yes|no]
[no] >>> yes

Then, you must specify the installation location. You can press Enter to accept the default.

Anaconda3 will now be installed into this location:
/root/anaconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

Next, you will be asked to initialize Anaconda3, press Yes to continue.

Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
[no] >>> yes

Wait to finish the process. You will get the following output:

Output
Thank you for installing Anaconda3!

Step 3 – Activate Anaconda Python Installer on Debian 12

At this point, you can activate your Anaconda installation with the following command:

source ~/.bashrc

You will see the base in your prompt shell:

(base) root@deb:/tmp#

Also, you can test your installation by running the following conda command:

conda info
Output
active environment : base
    active env location : /root/anaconda3
            shell level : 1
       user config file : /root/.condarc
 populated config files :
          conda version : 23.7.2
    conda-build version : 3.26.0
         python version : 3.11.4.final.0
       virtual packages : __archspec=1=x86_64
                          __glibc=2.36=0
                          __linux=6.1.0=0
                          __unix=0=0
       base environment : /root/anaconda3  (writable)
      conda av data dir : /root/anaconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /root/anaconda3/pkgs
                          /root/.conda/pkgs
       envs directories : /root/anaconda3/envs
                          /root/.conda/envs
               platform : linux-64
             user-agent : conda/23.7.2 requests/2.31.0 CPython/3.11.4 Linux/6.1.0-11-amd64 debian/12 glibc/2.36
                UID:GID : 0:0
             netrc file : None
           offline mode : False

Step 4 – Update Conda and Anaconda on Debian 12

Every time you want to update your Anaconda, first, you must update the conda utility with the command below:

conda update conda

Then, use the following command to update the Anaconda package:

conda update anaconda

To deactivate the base Anaconda environment, you can run the following command:

(base) root@deb:~# conda deactivate

Step 5 – Create a Test Environment with Anaconda

At this point, you can create a test environment with Python 3 with the following command on Debian 12:

conda create ––name test_environment python=3

Then, you can activate your environment with the command below:

conda activate test_environment

This will change your prompt shell to your environment. Now you have a shell environment with Python3 and you can start working with it.

Conclusion

At this point, you have learned to Install and Activate Anaconda Python on Debian 12 Bookworm from Command-Line. Also, you have learned to test your installation and create a test environment with Python. Hope you enjoy it.

For more guides and articles, you can visit the Orcacore website.

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!