54

I had to install the 64-bit version of Anaconda with python 3.5 in Windows 10. I followed the default settings (AppData/Continuum/Anaconda3). However, after installation, I am unsure how to access the Anaconda command prompt so that I can use conda to install packages. I also attempted to install Anaconda 64 bit in C:/Program Files, but several of the python script did not like the space and it failed to install.

What can I do to access the Anaconda prompt?

Mike Müller
  • 82,630
  • 20
  • 166
  • 161
user44796
  • 1,053
  • 1
  • 11
  • 20
  • The conda tool is an executable. If you let the anaconda install change modify your paths, it's accessible in your console (cmd.exe). – sascha Dec 20 '17 at 22:04
  • Have you tried `anaconda -h` in PowerShell or Command Prompt? – srikavineehari Dec 20 '17 at 22:09
  • Press Windows key, then search for Anaconda Prompt. – srikavineehari Dec 20 '17 at 22:15
  • @sascha I didn't do that with the 32-bit installation, and an anaconda command prompt was created in my windows start menu. During the installation, the Anaconda options states that this is not recommended. If I modify the system paths, will conda know which installation of Anaconda to use? – user44796 Dec 20 '17 at 22:18
  • @srig, both anaconda -h and searching for a 64-bit Anaconda Prompt failed. – user44796 Dec 20 '17 at 22:18
  • Proposed duplicate: [How to run Conda?](https://stackoverflow.com/questions/18675907/how-to-run-conda) Specifically, `conda init` is the current recommendation. – merv Oct 29 '20 at 21:32

6 Answers6

52

Go with the mouse to the Windows Icon (lower left) and start typing "Anaconda". There should show up some matching entries. Select "Anaconda Prompt". A new command window, named "Anaconda Prompt" will open. Now, you can work from there with Python, conda and other tools.

Mike Müller
  • 82,630
  • 20
  • 166
  • 161
  • 2
    Only the 32-bit version of the anaconda prompt shows up. – user44796 Dec 20 '17 at 22:26
  • 3
    Restarting? The cure-all thing for Windows. – Mike Müller Dec 20 '17 at 22:32
  • 2
    Haha. You are right about restarting. Maybe it will show up at some point. As a workaround, I can open a command prompt, cd to the Anaconda/scripts directory, and use conda. Then open spyder and use the installed packages. Not pretty, but it works. – user44796 Dec 20 '17 at 22:34
24

How to add Anaconda installation directory to your PATH variables

Adding Anaconda to your PATH variable will give you the ability to run a conda environment in any cmd or Powershell terminal window. Below are instructions on how to do that.

1. open environmental variables window

Do this by either going to my computer and then right-clicking the background for the context menu > "properties". On the left side open "advanced system settings" or just search for "env..." in the start menu ([Win]+[s] keys).

Then click on environment variables

If you struggle with this step read this explanation.

2. Edit Path in the user environmental variables section and add three new entries:

  • D:\path\to\anaconda3
  • D:\path\to\anaconda3\Scripts
  • D:\path\to\anaconda3\Library\bin

D:\path\to\anaconda3 should be the folder where you have installed anaconda

Click [OK] on all opened windows.

If you did everything correctly, you can test a conda command by opening a new powershell window.

conda --version

This should output something like: conda 4.8.2

Tobi Obeck
  • 1,918
  • 1
  • 19
  • 31
  • Also, one can use cmd.exe after reproducing these two steps, and then open a cmd and write `conda init cmd.exe`. After hitting the Enter and restarting the cmd, You can access all the conda environments. – Shayan Aug 19 '22 at 11:48
17

To run Anaconda Prompt using an icon, I made an icon and put:

%windir%\System32\cmd.exe "/K" C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3 (The file location would be different in each computer.)

at icon -> right click -> Property -> Shortcut -> Target

I see %HOMEPATH% at icon -> right click -> Property -> Start in

Test environment
   OS: Windows 10
   Library: Anaconda 10 (64 bit)

Cloud Cho
  • 1,594
  • 19
  • 22
10

I added "\Anaconda3_64\" and "\Anaconda3_64\Scripts\" to the PATH variable. Then I can use conda from powershell or command prompt.

Volker von Einem
  • 556
  • 4
  • 13
  • 5
    You should add \Anaconda3\Library\bin too, otherwise pip and other libs will not work. pip will fail with error: "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available." – Lybecker Apr 12 '19 at 07:06
4

If Anaconda Prompt is missing, you can create it by creating a shortcut file of Command Prompt (cmd.exe) and change its target to:

%windir%\System32\cmd.exe "/K" <Anaconda Location>\anaconda3\Scripts\activate.bat

Example:

%windir%\system32\cmd.exe "/K" C:\Users\user_1\AppData\Local\Continuum\anaconda3\Scripts\activate.bat

Abdulrahman Bres
  • 2,603
  • 1
  • 20
  • 39
0

After installing Anaconda3 on your system you need to add Anaconda to the PATH environment variable. This will allow you to access Anaconda with the 'conda' command from cmd.exe or PowerShell.

The link I provided below go through the three major issues with not recognized error. Which are:

  1. Environment PATH for Conda is not set
  2. Environment PATH is incorrectly added
  3. Anaconda version is older than the version of the Anaconda Navigator

LINK: https://appuals.com/fix-conda-is-not-recognized-as-an-internal-or-external-command-operable-program-or-batch-file/

My issue was resolved following the steps for issue #2 Environment PATH is incorrectly added. I did not have all three file paths in my variable environment.

djm457
  • 47
  • 1
  • 6