The official recommendation is not to add Anaconda / Python to the Windows PATH
environment variable (see Anaconda User Guide FAQ). But how can I ensure then that my custom build scripts find python? (e.g. my sphinx
make.bat
).
1 Answers
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.
Add the path where the
conda.exe
to thePATH
temporally:set PATH=C:\my\path\to\conda;%PATH%
Create a new environment:
conda create -n py36 python=3.6
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
.

- 82,630
- 20
- 166
- 161
-
1but should I endure this pain every time I want a quick python/ipython/jupyter session? Any suggestions on making this more practical? – charlie80 Oct 12 '17 at 06:59
-
Once you created the environment, you can write a file `myenv.bat` with this content: `set PATH=C:\my\path\to\conda;%PATH% & activate py36` and activate your environment with `myenv`. – Mike Müller Oct 12 '17 at 08:29
-
5I still don't really get why having conda on the path is such a bad thing. I suppose if you've got various different versions of conda for whatever nefarious reason, but is that the dominant case? – Craig Brett Nov 08 '17 at 17:09
-
4There is no problem with `conda`. But it also puts `python` on the `PATH`. This might interfere with other installed programs that use a different, already installed Python version. – Mike Müller Nov 12 '17 at 08:55
-
If you install the "console_shortcut" package, you get a start menu entry that is a shortcut to drop you into an activated shell. You get one shortcut for each environment that you install "console_shortcut" into. – msarahan Mar 07 '18 at 18:52
-
7I still maintain it's more of a pain to not have it on the path and have to either use the "special" anaconda prompt or keep adding it to the path manually. That and having user specific paths means that a team wide script to set up a prefix virtualenv for a project is impractical, as everyone's conda install location may be different. If there's a way around that particular use case, then maybe I can get over having commands usefully on the path – Craig Brett Apr 23 '18 at 14:22
-
@CraigBrett Indeed there is a better way now. Updated my answer. – Mike Müller Apr 23 '18 at 14:46