Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Activate Anaconda Python environment *persistently* in Windows

I can't figure out how to setup my Windows 7 machine so that it "always" finds my Python 3.6 Anaconda environment, which is not my root env. I don't want to have to do "activate ..." in a cmd window every time I want to use that env. And besides, there's a Spyder item in the start menu, for 3.6 (separate from default env), which won't work. I assume because of an env issue.

A robust solution greatly appreciated.

Dave

like image 397
D Strozzi Avatar asked Nov 09 '22 00:11

D Strozzi


1 Answers

I had a similar issue where every time I opened anaconda prompt it started with 'base' as the default environment. But the issue was that I was mostly working in a different custom environment so I had to activate it each time I wanted to use it. Here is the solution I found for autoactivating my preferred environment on a Windows 10 system:

  • Open anaconda prompt & use 'conda env list' to find the location of the environment you wish to use. enter image description here

  • Go to the start menu, right-click 'Anaconda Prompt' and go to file location. enter image description here

  • Create a copy of its shortcut

  • Open its properties & change the target to the location of your preferred environment.

    enter image description here

Now every time you open anaconda prompt through this shortcut it will automatically load your chosen environment.

like image 139
BOT_bkcd Avatar answered Nov 14 '22 20:11

BOT_bkcd