简体   繁体   中英

Trouble Setting up Windows Environment Variables for Anaconda2

I'm running Anaconda2 on Windows 7 and am having trouble running "python" from the command prompt.

I added "C:\ProgramData\Anaconda2" to PATH in Environment Variables and it allows my to run "python" from CMD. However, this is only true for CMD when I run it by clicking Start, typing cmd, and pressing enter. If I shift+right click from a window and select "Open command window here" and try to run python, I get the error "'python' is not recognized as an internal or external command, operable program or batch file."

For example, in the command windows below, the top one was started by running CMD from the start menu and then running python. The bottom window was opened by shift+right clicking in some location, selecting "Open command window here", then I even changed the directory to match the first window, but you can see "python" wasn't recognized.

CMD 蟒蛇

  1. Uninstall Python.
  2. Right click My Computer (Or This PC if Windows 7+) > Properties > Advanced System Settings and click on Environment Variables.
  3. In the user variables, select PATH and click on edit.
  4. Remove all the Python directories or delete the variable if there are no directories of other programs in the variable.
  5. Reinstall Python

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