Adding Anaconda to Path or not

43,933

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.

Share:
43,933

Related videos on Youtube

Xaser
Author by

Xaser

Updated on June 16, 2021

Comments

  • Xaser
    Xaser almost 3 years

    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).

  • charlie80
    charlie80 over 6 years
    but should I endure this pain every time I want a quick python/ipython/jupyter session? Any suggestions on making this more practical?
  • Mike Müller
    Mike Müller over 6 years
    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.
  • Craig Brett
    Craig Brett over 6 years
    I 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?
  • Mike Müller
    Mike Müller over 6 years
    There 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.
  • msarahan
    msarahan about 6 years
    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.
  • Craig Brett
    Craig Brett about 6 years
    I 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
  • Mike Müller
    Mike Müller about 6 years
    @CraigBrett Indeed there is a better way now. Updated my answer.