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:
Next, download the Anaconda installer as shown:
Once you have Anaconda downloaded, run the command below to begin the installation.
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:
NOTE: Replace the path to Anaconda as specified during the installation.
To verify that Conda is available, run the command:
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:
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:
$ source .bashrc
The commands above should add Anaconda to path.
On Windows, open the CMD and run the command:
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:
NOTE: Ensure that Anaconda is added to the path.
This article discusses three possible solutions to the ‘conda command not found.’