简体   繁体   中英

why python command does not invoke python interpreter in powershell though py is working

I am using windows 10 operating system. I had downloaded and installed Ananconda python 3.6 version for windows 64 bit.

I had added Anaconda to windows path manually. The current path is as below.

I have also added the PYTHONPATH variable. 在此处输入图片说明

The command py launches the python interpreter as below. 在此处输入图片说明

But the command python fails with below error.

在此处输入图片说明

How do I fix the issue. I am trying to run a simple hello World on sublime text but the same is failing with below error.

'python' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.0s with exit code 1]
[shell_cmd: python -u "D:\Python_Test\testprinting.py"]
[dir: D:\Python_Test]

I could not figure out the exact reason why python was not being recognized as a command even thought the path C:\\ProgramData\\Anaconda3\\ was added to the path variable with and without quotes "". I reinstalled the Anaconda3 package and then manually added the path. This time python command invokes the interpreter and its working fine in sublime text.

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