简体   繁体   中英

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

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. 在此处输入图片说明

  • Go to the start menu, right-click 'Anaconda Prompt' and go to file location. 在此处输入图片说明

  • Create a copy of its shortcut

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

    在此处输入图片说明

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM