273

I installed Anaconda3 4.4.0 (32 bit) on my Windows 7 Professional machine and imported NumPy and Pandas on Jupyter notebook so I assume Python was installed correctly. But when I type conda list and conda --version in command prompt, it says conda is not recognized as internal or external command.

I have set environment variable for Anaconda3; Variable Name: Path, Variable Value: C:\Users\dipanwita.neogy\Anaconda3

How do I make it work?

darthbith
  • 18,484
  • 9
  • 60
  • 76
Kshitiz
  • 3,431
  • 4
  • 14
  • 22

17 Answers17

417

I was faced with the same issue in windows 10, Updating the environment variable following steps, it's working fine.

I know It is a lengthy answer for the simple environment setups, I thought it's may be useful for the new window 10 users.

1) Open Anaconda Prompt:

enter image description here

2) Check Conda Installed Location.

where conda

enter image description here

3) Open Advanced System Settings

enter image description here

4) Click on Environment Variables

enter image description here

5) Edit Path

enter image description here

6) Add New Path

 C:\Users\RajaRama\Anaconda3\Scripts

 C:\Users\RajaRama\Anaconda3

 C:\Users\RajaRama\Anaconda3\Library\bin

enter image description here

7) Open Command Prompt and Check Versions

8) After 7th step type conda install anaconda-navigator in cmd then press y

enter image description here

Raja Rama Mohan Thavalam
  • 8,131
  • 2
  • 31
  • 30
  • 20
    Also add `C:\Users\yourusername\Anaconda3\Library\bin` to your path variable. This will prevent an SSL error that is bound to happen if you're performing this on a fresh install of Anaconda. Thanks, Thomas Matthew – Vasim Dec 31 '19 at 18:41
  • 2
    Thanks Raja. The answer is especially relevant to those who installed their Anaconda/Spyder on a drive other than a (windows) system drive. – Pierre Bonaparte Jul 12 '20 at 12:28
  • 3
    @Vasim your step is required to conda to work as well. thanks – LOrD_ARaGOrN Sep 13 '21 at 06:24
  • 1
    9) the last step would be to run `conda activate base` from `cmd` per [this_help_link](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment) in case you get a warning. – gregV Oct 21 '21 at 17:42
  • 2
    Thanks for this step-by-step answer. After adding the environment variables, it was also necessary to restart my computer. Alternatively: https://search4fan.github.io/post/win10_new_system_variable_without_restart.html – Rens Nov 17 '21 at 09:05
215

Although you were offered a good solution by others I think it is helpful to point out what is really happening. As per the Anaconda 4.4 changelog, https://docs.anaconda.com/anaconda/reference/release-notes/#what-s-new-in-anaconda-4-4:

On Windows, the PATH environment variable is no longer changed by default, as this can cause trouble with other software. The recommended approach is to instead use Anaconda Navigator or the Anaconda Command Prompt (located in the Start Menu under “Anaconda”) when you wish to use Anaconda software.

(Note: recent Win 10 does not assume you have privileges to install or update. If the command fails, right-click on the Anaconda Command Prompt, choose "More", chose "Run as administrator")

This is a change from previous installations. It is suggested to use Navigator or the Anaconda Prompt although you can always add it to your PATH as well. During the install the box to add Anaconda to the PATH is now unchecked but you can select it.

DougL
  • 3
  • 2
John Morrison
  • 3,810
  • 1
  • 15
  • 15
  • 2
    I am experiencing this issue with MiniConda. I'm not sure what path to add since the paths suggested here don't exist on my machine – user32882 Jul 20 '17 at 13:38
  • 2
    You will need the path of where you installed Miniconda. Possibly C:\Users\yourusername\Miniconda or similar. – John Morrison Jul 20 '17 at 16:33
46

I found the solution. Variable value should be C:\Users\dipanwita.neogy\Anaconda3\Scripts

Kshitiz
  • 3,431
  • 4
  • 14
  • 22
  • 7
    I am using Pycharm and want to use conda as interpreter, I added path for conda but it still does not recognize it. even when I use cmd in windows, I get 'conda is not recognized...' – Rio Oct 17 '18 at 14:19
42

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

While during the installation process you can check this box, you can also add python and/or python to your path manually (as you can see below the image)

enter image description here

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

where python
where conda

Next, you can add Python and Conda to your path by using the setx command in your command prompt (replace C:\Users\mgalarnyk\Anaconda2 with the results you got when running where python and where conda).

SETX PATH "%PATH%;C:\Users\mgalarnyk\Anaconda2\Scripts;C:\Users\mgalarnyk\Anaconda2"

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

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
31

Just to be clear, you need to go to the controlpanel\System\Advanced system settings\Environment Variables\Path, then hit edit and add:

C:Users\user.user\Anaconda3\Scripts

to the end and restart the cmd line

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
Carl
  • 341
  • 2
  • 9
11

In addition to adding C:\Users\yourusername\Anaconda3 and C:\Users\yourusername\Anaconda3\Scripts, as recommended by Raja (above), also add C:\Users\yourusername\Anaconda3\Library\bin to your path variable. This will prevent an SSL error that is bound to happen if you're performing this on a fresh install of Anaconda.

Thomas Matthew
  • 2,826
  • 4
  • 34
  • 58
7

If you have a newer version of the Anaconda Navigator, open the Anaconda Prompt program that came in the install. Type all the usual conda update/conda install commands there.

I think the answers above explain this, but I could have used a very simple instruction like this. Perhaps it will help others.

MokeEire
  • 638
  • 1
  • 8
  • 19
  • with the explanation in other posts, I think this is the best method other than manually typing in the environment path for conda! – yfeng Jul 23 '19 at 16:45
7

For conda --version greater than 4.6, from the base of your Anaconda promt, run

conda update conda
conda init

This will update your conda root environment and setup the stuff you need to run it on both cwd and powershell.

After this, you can start any terminal and it will be conda ready.

zeeshan khan
  • 376
  • 4
  • 12
  • I had selected the path variables on install for windows. But that did not work. Adding the path manually did not solve, restarding did not solve. But going in prompt conda and typing "conda init" resolved it. The console showed that some script folder files where "modified" by this command. Most were unchanged. – Alexandre Jean Apr 07 '23 at 00:34
7

For those who didn't check "Add Anaconda to my PATH environment variable". In Windows 10 it looks like that:

enter image description here

5 paths:

C:\Users\shtosh\anaconda3
C:\Users\shtosh\anaconda3\Library\mingw-w64\bin
C:\Users\shtosh\anaconda3\Library\usr\bin
C:\Users\shtosh\anaconda3\Library\bin
C:\Users\shtosh\anaconda3\Scripts
shtosh
  • 95
  • 1
  • 6
4

Go To anaconda prompt(type "anaconda" in search box in your laptop). type following commands

where conda

add that location to your environment path variables. Close the cmd and open it again

Pallamolla Sai
  • 2,337
  • 1
  • 13
  • 14
4

This problem arose for me when I installed Anaconda multiple times. I was careful to do an uninstall but there are some things that the uninstall process doesn't undo.

In my case, I needed to remove a file Microsoft.PowerShell_profile.ps1 from ~\Documents\WindowsPowerShell\. I identified that this file was the culprit by opening it in a text editor. I saw that it referenced the old installation location C:\Anaconda3\.

Aaron
  • 379
  • 5
  • 14
3

Please install conda on your machine: conda installation document

If conda already installed on your machine then:

Open Anaconda prompt, and type

conda init powershell

Open PowerShell and it should work.

whitetiger1399
  • 423
  • 3
  • 6
2

If you don't want to add Anaconda to env. path and you are using Windows try this:

  • Open cmd;
  • Type path to your folder instalation. It's something like: C:\Users\your_home folder\Anaconda3\Scripts
  • Test Anaconda, for exemple type conda --version.
  • Update Anaconda: conda update conda or conda update --all or conda update anaconda.

Update Spyder:

  • conda update qt pyqt
  • conda update spyder
Dragos Alexe
  • 131
  • 2
2

I have Windows 10 64 bit, this worked for me, This solution can work for both (Anaconda/MiniConda) distributions.

  1. First of all try to uninstall anaconda/miniconda which is causing problem.
  2. After that delete '.anaconda' and '.conda' folders from 'C:\Users\'
  3. If you have any antivirus software installed then try to exclude all the folders,subfolders inside 'C:\ProgramData\Anaconda3\' from

    • Behaviour detection.
    • Virus detection.
    • DNA scan.
    • Suspicious files scan.
    • Any other virus protection mode.

    *(Note: 'C:\ProgramData\Anaconda3' this folder is default installation folder, you can change it just replace your excluded path at installation destination prompt while installing Anaconda)*

  4. Now install Anaconda with admin privileges.
    • Set the installation path as 'C:\ProgramData\Anaconda3' or you can specify your custom path just remember it should not contain any white space and it should be excluded from virus detection.
    • At Advanced Installation Options you can check "Add Anaconda to my PATH environment variable(optional)" and "Register Anaconda as my default Python 3.6"
    • Install it with further default settings. Click on finish after done.
    • Restart your computer.

Now open Command prompt or Anaconda prompt and check installation using following command

conda list

If you get any package list then the anaconda/miniconda is successfully installed.

k33da_the_bug
  • 812
  • 8
  • 16
2

I have just launched anaconda-navigator and run the conda commands from there.

Ganesh Kanna
  • 2,269
  • 1
  • 19
  • 29
1

if you use chocolatey, conda is in C:\tools\Anaconda3\Scripts

dkocich
  • 221
  • 4
  • 7
0

I had this problem in windows. Most of the answers are not as recommended by anaconda, you should not add the path to the environment variables as it can break other things. Instead you should use anaconda prompt as mentioned in the top answer.

However, this may also break. In this case right click on the shortcut, go to shortcut tab, and the target value should read something like:

%windir%\System32\cmd.exe "/K" C:\Users\myUser\Anaconda3\Scripts\activate.bat C:\Users\myUser\Anaconda3
anishtain4
  • 2,342
  • 2
  • 17
  • 21