Site icon WP 301 Redirects

How to Fix Conda Command Not Found

So you opened your terminal. You typed conda. And boom. You saw the scary message: “conda: command not found.” Annoying, right? Do not worry. This is a very common issue. And the fix is usually simple. Let’s walk through it step by step in a fun and easy way.

TLDR: If you see “conda command not found,” it usually means Conda is not installed or not added to your system PATH. First, check if Conda is installed. Then make sure your shell knows where to find it. You may need to initialize Conda or update your PATH variable. Restart your terminal after making changes.


Why This Happens

Your computer needs to know where programs live. When you type a command, like conda, your system searches for it in special folders. These folders are listed in something called the PATH.

If Conda is not installed, or its folder is not listed in the PATH, your system shrugs and says: “command not found.”

There are four common reasons:

Now let’s fix it.


Step 1: Check If Conda Is Installed

First, let’s see if Conda exists on your machine.

Open your terminal and type:

which conda

On Windows, use:

where conda

If you see a path like this:

/home/user/miniconda3/bin/conda

Good news. Conda is installed.

If you see nothing, or an error, then Conda is probably not installed.

You can also try:

conda --version

If it shows a version number, you are good. If not, move to the next step.


Step 2: Install Conda (If It’s Missing)

If Conda is not installed, you need to install it.

You have two popular options:

Most people prefer Miniconda because it is simple.

Go to the official website. Download the installer for your system. Then run it.

On macOS or Linux:

bash Miniconda3-latest-Linux-x86_64.sh

Follow the instructions. Say “yes” when it asks to initialize Conda.

On Windows, just double-click the installer and follow the wizard.

After installation, close and reopen your terminal.

Now try:

conda --version

If it works, you are done. 🎉


Step 3: Initialize Conda

If Conda is installed but still not working, your shell may not be initialized.

Initialization tells your terminal how to use Conda.

Run this command:

conda init

You may see something like:

modified ~/.bashrc

Or:

modified ~/.zshrc

That’s good.

Now restart your terminal.

If it still does not work, manually reload your shell:

source ~/.bashrc

Or:

source ~/.zshrc

Then test again:

conda --version

Step 4: Add Conda to PATH Manually

If initialization did not fix it, you may need to edit your PATH.

First, find where Conda is installed.

Common locations:

Inside that folder, look for the bin directory (on macOS/Linux).

It might look like this:

/home/user/miniconda3/bin

Now open your shell configuration file.

If you use bash:

nano ~/.bashrc

If you use zsh:

nano ~/.zshrc

Add this line at the bottom:

export PATH="$HOME/miniconda3/bin:$PATH"

Save the file. Exit. Then run:

source ~/.bashrc

Or restart the terminal.

Try:

conda --version

It should now work.


Step 5: Windows Users – Special Tips

If you are on Windows, things are a little different.

Sometimes Conda works in Anaconda Prompt but not in Command Prompt or PowerShell.

That means PATH was not added system-wide.

Here’s how to fix it:

  1. Open the Start menu.
  2. Search for “Environment Variables.”
  3. Click “Edit the system environment variables.”
  4. Click “Environment Variables.”
  5. Find “Path” under User variables.
  6. Click Edit.
  7. Add your Conda install paths.

You usually need to add:

Click OK. Restart your terminal.

Now test:

conda --version

Step 6: Check Your Default Shell

Sometimes Conda is configured for one shell, but you are using another.

For example:

That causes confusion.

Check your current shell:

echo $SHELL

If needed, initialize Conda for that shell:

conda init zsh

Or:

conda init bash

Restart. Test again.


Step 7: Running Conda in VS Code

Sometimes Conda works in your normal terminal but not inside VS Code.

This usually means VS Code is using a different shell.

Inside VS Code:

You can also fully restart VS Code after installation.


Step 8: Restart Everything

This sounds silly. But it works.

After installing or updating PATH:

Your system sometimes needs a fresh start.


Bonus: Make Sure You Activate an Environment

Sometimes users think Conda is broken. But they really forgot to activate an environment.

Try:

conda activate base

If that works, Conda is fine.

If you see:

“CommandNotFoundError: Your shell has not been properly configured.”

Then go back and run:

conda init

Quick Troubleshooting Checklist

If you are still stuck, go through this simple list:

Most problems are solved by these steps.


Common Mistakes to Avoid

Keep it simple. One step at a time.


Final Thoughts

The “conda command not found” error looks scary. But it is usually small. Your system just cannot find the program.

In most cases, the fix is one of these:

That’s it.

Do not panic. Do not reinstall your whole system. And definitely do not throw your laptop out the window.

Take a breath. Follow the steps. And soon, you will see something beautiful:

conda 24.x.x

Success. 😊

Exit mobile version