Looking to install Anaconda on your Debian system?
We’ve got you covered!
Anaconda provides script files to install it on Linux systems, including Debian.
Using your terminal and a few commands, you can turn that script into an executable file and run that executable file to install Anaconda Python.
So if you’re running Debian 12 and you’re interested in installing Anaconda on it, this guide will show you step-by-step how to do that.
What You’ll Need
Before jumping into the tutorial, here are everything you need to install Anaconda on Debian:
- Debian 12 installed and running (guide)
- A stable internet connection
- Enough disk space (1GB installation file and 10GB+ for installation)
- Familiarity with the Command Line Interface
- A few dependencies to use the GUI packages (covered in Step 4 of this guide)
With all that covered, let’s move on to the main step-by-step guide.
How to Install Anaconda Python on Debian 12: Step-By-Step
Step 1: Download Anaconda
The first step is to download Anaconda for Linux.
- Go to the official Anaconda website.
- Click the green Download button to download the installer.
- Since it’s a large-sized file, it may take a while to be downloaded.
Step 2: Verify the Installer’s Data Integrity
The team behind Anaconda provides you with a way to verify the integrity of the downloaded file using the SHA-256 hashing algorithm. This will ensure that the file you’ve downloaded has not been tampered with or corrupted during its download or distribution. If the hashes match, then you have the valid file.
- To verify a file’s data integrity, the basic command is as follows:
shasum -a 256 /PATH/FILENAME
Instead of /PATH/FILENAME, you enter the full file path of the target file. So in our case, the command will look as follows. Take note you should receive a hash value in return, as seen in below screenshot::
shasum -a 256 ~/Downloads/Anaconda3-2023.07-2-Linux-x86_64.sh
- Visit the Anaconda webpage to find the provided hash value. Click on the file you originally downloaded.
- Scroll down to find the SHA-256 hash value of that file. As you can see in the screenshot below, the value matches the one we received in our terminal earlier. This is enough to verify the installer file’s data integrity.
Step 3: Install Anaconda on Debian 12
Once you’ve downloaded the installation script, you can start installing it.
- Locate the downloaded file on your device. Unless you chose a specific directory to save it in, the default directory is ~/Downloads. Check whether the installation file is in that directory using this command:
- Since it’s a script file, it’s not yet usable in a Linux environment. You need to turn it into an executable file. To do that, run the below command:
sudo chmod +x ~/Downloads/Anaconda3-2023.07-2-Linux-x86_64.sh
- Now the installation script is ready for use. To install Anaconda on Debian, execute this command:
- You’ll be asked to check their license agreement. Press Enter to review it.
- When you’re done reading the agreement, press Q. This will bring a prompt where you need to enter yes or no. Enter yes and then press Enter.
- Now you will be shown the location where Anaconda will be installed. If it seems correct, press the Enter key to confirm. Otherwise, you can also specify a different location or cancel the installation by pressing the Ctrl + C keys.
- This will start the installation process. Wait until you see the next prompt, as shown in the screenshot below:
- Next, after Anaconda is installed, you’ll be asked to initialize it. You can enter yes to do that, or if you’d like to do it later, enter no. We will initialize it now.
- And that should finish installing Anaconda on your Debian system.
Step 4: Install Necessary Dependencies For Anaconda Navigator
After installing Anaconda, you must install some extra packages necessary for Qt.
Qt is an open-source software used for developing graphical user interfaces of applications.
So if you don’t have those packages, you won’t be able to fully utilize Qt on your system and in turn fail to use the GUI packages of Anaconda.
- Install all the packages with this single command:
sudo apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
Step 5: Confirm If Anaconda was Successfully Installed on Your Device
Now that you’ve installed Anaconda, let’s check if the installation was successful.
- First, exit the terminal window by pressing the X button on the top right corner.
- Open a new terminal window.
- If you don’t want to close and re-open the terminal, you can also refresh it using this command:
- If the installation was successful and you initialized it as well, you should see the word base written inside parentheses before the shell prompt. Base is the default Python environment you get after installing Anaconda.
- Another way to do this is by checking the version number of conda. To do that, run this command:
As you can see, it returns version number 23.7.2 which means we have access to it.
- There are alternative ways to verify this. You can use the conda list command to display the installed Anaconda packages, like this:
- You can also open the anaconda-navigator to verify your installation. To open that, run this command:
So that’s how you can confirm Anaconda’s installation.
If you’ve successfully installed it, the next step is to configure it.
How to Activate and Deactivate Anaconda on Debian 12
If you choose not to initialize Anaconda automatically during installation, you can still activate it manually later.
- To activate Anaconda, run the below command:
- You can also deactivate it. To do so, use this command:
- But what if you want to configure conda so that it activates or deactivates the base environment automatically every time you open the terminal? You can do that with the following commands:
conda config --set auto_activate_base True # activates the base environment by default conda config --set auto_activate_base False # deactivates the base environment by default
Note: These commands will work only if you execute conda init first.
Congratulations on installing Anaconda on your Debian 12 system!
This guide showed you the necessary steps for installing Anaconda Python on Debian 12.
We’ve also covered how you can confirm your installation and how you can use Anaconda’s base Python environment on your terminal.
This should get you started with Python programming on the Anaconda distribution.
If you’d like to install Anaconda on Ubuntu, we also have a guide for that.
If this guide helped you, please share it.