简体   繁体   中英

Changing Python Path in Windows

I have 2 distribution of Python3 in my PC. One is using Anaconda distribution and another is from MSYS2 distribution for Windows. I've always use the Anaconda one for all my works. But, somehow when I type python in command line yesterday, it showed that I use the MSYS2 distribution. When I type which python it showed /mingw64/bin/python instead of /PATH/TO/Anaconda3/ . My question is how to change the python path to use Anaconda distribution instead? I'm running on Windows 10.

On Windows, if you click on the Start Menu, you will see an item for "Anaconda 3". From there you can select "Anaconda Prompt", which will launch a command shell with the environment variables set up for Anaconda.

Another way to do it is to run /PATH/TO/Anaconda3/Scripts/activate.bat, which will do the same initialization.

The msys2 python is showing up because it's appearing earlier in your PATH environment variable. If you're normally using Anaconda, you should generally explicitly set the Anaconda environment you want using "activate" so you know which Python and packages you're going to get.

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