DEV Community

Cover image for How to install Anaconda on Arch Linux
Amal Satheesan
Amal Satheesan

Posted on

How to install Anaconda on Arch Linux

Disclaimer: In this guide, I'm using Miniconda, a lightweight version of Anaconda available from the Arch Linux repository.

Links:

Step 1: Clone the Package to Your System

  1. Click on the Git Clone URL and copy the repository link.
  2. Open your terminal and navigate to your desired directory. Here, I'm moving to the /Downloads/ directory.
git clone https://aur.archlinux.org/packages/anaconda
Enter fullscreen mode Exit fullscreen mode

Once the cloning process completes successfully, proceed to the next step.

Step 2: Install the Package into Your System

  1. Open a terminal and change directory to where you cloned the repository.
cd /Downloads/anaconda
Enter fullscreen mode Exit fullscreen mode
  1. Build and install the package using makepkg.
makepkg -si
Enter fullscreen mode Exit fullscreen mode

This process will take some time. Once it finishes, proceed to the next steps.

  1. Locate the installation script, typically named anaconda_xxxxxx.sh. Make it executable from the terminal.
sudo chmod +x anaconda_xxxxxx.sh
Enter fullscreen mode Exit fullscreen mode
  1. Execute the installation script.
sudo ./anaconda_xxxxxx.sh
Enter fullscreen mode Exit fullscreen mode

Follow the on-screen prompts, including reading the agreement and typing yes to proceed with the setup.

Creating Environment and Example

To activate the base environment:

conda activate base
Enter fullscreen mode Exit fullscreen mode

You'll see (base) in front of your terminal prompt indicating the base environment is active.

For those who installed Anaconda, you can launch Anaconda Navigator using:

anaconda-navigator
Enter fullscreen mode Exit fullscreen mode

That's it for Anaconda installation.

Miniconda Verification

Verify the Miniconda installation by checking its version:

conda --version
Enter fullscreen mode Exit fullscreen mode

Checking Miniconda Path

To ensure Miniconda's binaries are in your PATH:

echo $PATH
Enter fullscreen mode Exit fullscreen mode

Look for a directory like /path/to/miniconda3/bin in the output. If it's missing, you'll need to add it to your PATH.

Assuming everything is correct, activate the base environment again:

conda activate base
Enter fullscreen mode Exit fullscreen mode

Opening Jupyter Notebook

Install Jupyter Notebook:

conda install jupyter notebook
Enter fullscreen mode Exit fullscreen mode

Then, launch Jupyter Notebook:

jupyter-notebook
Enter fullscreen mode Exit fullscreen mode

You've successfully run Jupyter Notebook with Miniconda.

Extra Perks

1. Creating a New Conda Environment

Create a new environment specifying Python version and install packages:

conda create -n <env_name> python=<version>
conda activate <env_name>
Enter fullscreen mode Exit fullscreen mode

For example:

conda create -n myenv python=3.9
conda activate myenv
conda install numpy
Enter fullscreen mode Exit fullscreen mode

2. Listing and Deleting Environments

List all environments:

conda env list
Enter fullscreen mode Exit fullscreen mode

Delete an environment:

conda env remove -n <env_name>
Enter fullscreen mode Exit fullscreen mode

3. Deactivating an Environment

Deactivate the current environment:

conda deactivate
Enter fullscreen mode Exit fullscreen mode

For more information on managing environments, refer to this link.

Top comments (0)