Adding Anaconda to Path or not

Xaser picture Xaser · Jul 19, 2017 · Viewed 38k times · Source

The official recommendation is not to add Anaconda / Python to the Windows PATH environment variable. But how can I ensure then that my custom build scripts find python? (e.g. my sphinx make.bat).

Answer

Mike Müller picture Mike Müller · Jul 19, 2017

UPDATE

Current Anaconda installations offer an "Anaconda Prompt" that has conda on the path. Go to the Windows start button (Window icon) and start typing anaconda. You should see an entry "Anaconda Prompt". Click on it. A new window opens that has conda in the search path. Use as many Anaconda prompts as needed.

Old Answer

A good way is to work with conda environments.

  1. Add the path where the conda.exe to the PATH temporally:

    set PATH=C:\my\path\to\conda;%PATH%

  2. Create a new environment:

    conda create -n py36 python=3.6

  3. Activate it:

    activate py36

Now the prompt should change to py36 and all should work since all needed paths are set. You need to install all your packages you need for your project while this environment is activated. When done deactivate it with deactivate.