Python

Conda Command not Found

Conda is a free, cross-platform, open-source package and environment management system.

Conda allows you to install, update, and uninstall packages and dependencies straight from the command line.

Although it is mainly associated with Python, Conda can be used to install packages for other languages such as R, Ruby, Lua, etc.

This article will discuss how to resolve the ‘conda command not found’ error in your system.

Fix 1: Install Conda

If you face the ‘conda command not found’ error, the first and most common solution is to ensure you have conda installed.

You can install conda using either the anaconda or miniconda packages. In this tutorial, we will use the anaconda installer.

Open your Linux terminal and update your system repo:

$ sudo apt-get update

Next, download the Anaconda installer as shown:

$ wget https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh

Once you have Anaconda downloaded, run the command below to begin the installation.

$ bash ~/Downloads/Anaconda3-2022.05-Linux-x86_64.sh

The installer will launch the installation process. Follow along and note the directory where Anaconda is installed.

Once completed, press yes to initialize Conda.

Once completed, add Conda to path as shown in the command below:

export PATH=/home/debian/anaconda3/bin:$PATH

NOTE: Replace the path to Anaconda as specified during the installation.

To verify that Conda is available, run the command:

conda --version

conda 4.12.0

You can also add the path into your .bashrc file to ensure persistency across your terminal sessions.

If you are on Windows, download the Anaconda Installer in the resource below:

https://www.anaconda.com/products/distribution#windows

Select your installer version and download it.

Once completed, start the installer and follow along with the installation instructions.

In the ‘Advanced Options’ windows, to select ‘Add Anaconda3 to my PATH environment variable’ as shown:

To verify that Anaconda is installed, open your terminal window and run the command.

Fix 2: Update Path.

If you already have Anaconda installed, you can fix the error by adding Anaconda to the path as shown:

Linux:

$ echo 'export PATH=/path/to/anaconda3/bin:$PATH' >> ~/.bashrc

$ source .bashrc

The commands above should add Anaconda to path.

On Windows, open the CMD and run the command:

set PATH=%PATH%;"C:\path\to\anaconda3"

It should add Anaconda to your path environment variable.

Fix 3: Initialize Conda

The third option you can try is to initialize conda. Open your terminal and run the command:

$ conda init.

NOTE: Ensure that Anaconda is added to the path.

Closing

This article discusses three possible solutions to the ‘conda command not found.’

About the author

John Otieno

My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list