Post169
Post169

Reputation: 708

Errors with conda commands on Windows 10

I'm getting started on Python 2.7, using the Anaconda package and its Spyder IDE, but when I find out that something I want to do requires that I execute a command that starts with the word "conda", I have terrible trouble.

I first assumed that those were commands to type in the IPython console in Spyder, but instead of executing what I commanded, it told me NameError: name 'conda' is not defined.

I also tried the Windows Command Prompt (cmd.exe), but it told me conda is not recognized as an internal or external command. Some results when I googled that claimed that I had to add one of the Anaconda-related folders to Windows' Path, so I tried that, but still no good.

How can I carry out conda commands on Windows 10?

Upvotes: 0

Views: 1838

Answers (2)

Ankur Kumar
Ankur Kumar

Reputation: 51

Just Run Command Prompt with Admin permission then it will install desired package and will work perfectly

Upvotes: 2

Post169
Post169

Reputation: 708

First thing, you're right that those commands are not intended for the IPython console. Second, there is a good reason they are not working in the cmd.exe Command Prompt.

They are actually intended to be given to the Anaconda Prompt. On Windows, start typing "Anaconda Prompt" and, if you have Anaconda correctly installed, you should see an icon very similar to that of cmd.exe, except the "C:_" on the black background will be grey instead of white. That is where these commands are to be given.

If you are not sure which user/users Anaconda was installed for, it may take some extra time. If it was installed for all, or you're not sure, then you should go ahead and left-click the icon. If it was installed for you, everything should go fine, at least as far as permissions go.

If it was not installed for you, then it will at first seem to be obeying you when you command it to modify the software. It will fetch the metadata, tell you that these things will be installed or updated, and then ask you Proceed ([y]/n)? And then, after you type in y and hit Enter, it will tell you CondaIOError: IO error: Missing write permissions in: C:\Program Files\Anaconda3. Now you know, you need to open the Anaconda Prompt by right-clicking the icon and clicking "Run as administrator". Then you can type in your conda install... or conda update... command and see it carried out. (This might only be possible if your Windows account is an administrator account; if that is true and you're not an administrator, you'll probably need to ask someone who has an administrator account for help.)

Credit to users on Google Groups for showing this solution.

Upvotes: 1

Related Questions