Why Anaconda does not recognize conda command?

PythonAnacondaConda

Python Problem Overview


I installed the latest version of Anaconda. Now I want to install OpenCV within it. When I type:

conda install -c https://conda.binstar.org/anaconda opencv

I get this message error: "conda is not recognized as internal command ..." (sorry, I try to translate from French because my OS is in French)

The problem is that conda comes with Anaconda, so I wonder why lauching Anaconda and type the above command does not work ?

Python Solutions


Solution 1 - Python

For Windows

Go to Control Panel\System and Security\System\Advanced System Settings then look for Environment Variables.

Your user variables should contain Path=Path\to\Anaconda3\Scripts.

You need to figure where your Anaconda3 folder is (i.e. the path to this folder) . Mine was in C:\Users.

For Linux

You need to add conda to PATH. To do so, type:

export PATH=/path/to/anaconda3/bin:$PATH.

Same thing, you need to figure the path to anaconda3 folder (Usually, the path is stored in $HOME)

If you don't want to do this everytime you start a session, you can also add conda to PATH in your .bashrc file:

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

Solution 2 - Python

I had a similar problem. I searched conda.exe and I found it on Scripts folder. So, In Anaconda3 you need to add two variables to PATH. The first is Anaconda_folder_path and the second is Anaconda_folder_path\Scripts

Solution 3 - Python

When you install anaconda on windows now, it doesn't automatically add Python or Conda to your path so you have to add it yourself.

If you don’t know where your conda and/or python is, you type the following commands into your anaconda prompt

enter image description here

Next, you can add Python and Conda to your path by using the setx command in your command prompt. enter image description here

Next close that command prompt and open a new one. Congrats you can now use conda and python

Source: https://medium.com/@GalarnykMichael/install-python-on-windows-anaconda-c63c7c3d1444

Solution 4 - Python

I had a similar problem and I did something like the below mentioned steps with my Path environment variable to fix the problem

> 1. Located where my Anaconda3 was installed. I run Windows 7. Mine is located at C:\ProgramData\Anaconda3. > > 2. Open Control Panel - System - Advanced System Settings, under Advanced tab click on Environment Variables. > > > > 3. Under System Variables, located "Path" add the following: C:\ProgramData\Anaconda3\Scripts;C:\ProgramData\Anaconda3;

Save and open new terminal. type in "conda". It worked for me.

Hope these steps help

Solution 5 - Python

You probably need to update your PATH variable to include where you have installed Anaconda.

See https://github.com/ContinuumIO/anaconda-issues/issues/41 for a similar issue.

Solution 6 - Python

Same problem with Anaconda running on Ubuntu 15.10. I closed the terminal and opened a new window and it worked fine.

Solution 7 - Python

Faced the same problem running on Windows 10 and using the Windows cmd.

Solved it by running the following command in the Anaconda Prompt which comes with Anaconda3 (as administrator):

conda install -c menpo opencv3=3.1.0

Command found on the official website: https://anaconda.org/menpo/opencv3

Solution 8 - Python

I suspect you forget to export PATH, anaconda/bin must be added in your $PATH. (Linux, OSX common problem). On Windows make sure you run install and commands as administrator.

Solution 9 - Python

Try setting the file path using (for anaconda3)...

export PATH=~/anaconda3/bin:$PATH

Then check whether it worked with...

conda --version

This worked for me when 'conda' was returning 'command not found'.

Solution 10 - Python

If this problem persists, you may want to check all path values in the PATH variable (under Control Panel\System and Security\System\Advanced System Settings). It might be that some other path is invalid or contains an illegal character.

Today, I had the same problem and found a double quote in a different path value in the PATH variable. All paths after that (including a fresly installed conda) were not usable. Removing the double quote solved the problem.

Solution 11 - Python

Try restarting the terminal, I had the same issue, worked after restarting the terminal.

Solution 12 - Python

In Windows 10, I went to the folder where Anaconda is stored. In my case it is in \Anaconda3 folder as a shortcut to open a command prompt window, called "Anaconda Prompt". Open that and execute the command there.

Solution 13 - Python

Got same issue and it turns out that besides setting PATH variable, I also should not close some cmd window poped up during installation. Re-installation would work

Solution 14 - Python

As other users said, the best way for Windows users is to set the global environment variable.

I install the Miniconda3 for MXNet.

Before I do something, only Anaconda Prompt works for conda.

After setting the global environment variable, The CMD and Git Bash work. But in some IDEs like RStudio, the nested Git Bash doesn't work.

After restarting my computer, the Git Bash in the RStudio works for conda.

I hope these tests helps for you.

Solution 15 - Python

It's not recommended to add conda.exe path directly into the System Environment Variables at stated by anaconda installer :

enter image description here

For Windows Users, Open Conda Prompt Shortcut and change the Target into the Correct Address :

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser4584333View Question on Stackoverflow
Solution 1 - Pythonfabda01View Answer on Stackoverflow
Solution 2 - PythonAli IsmayilovView Answer on Stackoverflow
Solution 3 - PythonMichael James Kali GalarnykView Answer on Stackoverflow
Solution 4 - PythonHakim SultanovView Answer on Stackoverflow
Solution 5 - PythonChironianView Answer on Stackoverflow
Solution 6 - Pythonscdavis50View Answer on Stackoverflow
Solution 7 - PythonEskappView Answer on Stackoverflow
Solution 8 - Pythonares777View Answer on Stackoverflow
Solution 9 - PythonFinger Picking GoodView Answer on Stackoverflow
Solution 10 - PythonJohanView Answer on Stackoverflow
Solution 11 - PythonAnubhavView Answer on Stackoverflow
Solution 12 - PythonwrightwxView Answer on Stackoverflow
Solution 13 - PythonJoseph LiuView Answer on Stackoverflow
Solution 14 - PythonJiaxiangView Answer on Stackoverflow
Solution 15 - PythonsmbanaeiView Answer on Stackoverflow