Home > Software engineering >  he term 'python' is not recognized as the name of a cmdlet
he term 'python' is not recognized as the name of a cmdlet

Time:01-28

how can i solve this? iam trying run this command in vs code terminal but its keep giving this eror

PS C:\Users\Hesam\Desktop\cloud> python src/stats.py --chat_json C:\Users\Hesam\Desktop\chat ex\result.json --output_dir C:\Users\Hesam\Desktop\res.png
python : The term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name

i am just want to run this project

CodePudding user response:

at the very first in the place you typed "python" type py. I mean type py instead of python. I hope it will work

py src/stats.py --chat_json C:\Users\Hesam\Desktop\chat ex\result.json --output_dir C:\Users\Hesam\Desktop\res.png

CodePudding user response:

If you're still having problems, try this:

  1. Searching for and click on Edit the system environment variables in the Windows search bar
  2. Click on Environment variables in the bottom right corner
  3. Scroll down under User variables for {YOUR_USERNAME} and double-click on Path
  4. On the right click New and enter in the path to Python on your computer (it should look something like this: C:\Users\{USERNAME}\AppData\Local\Programs\Python\Python{VERSION}\) (If you've already done this, there should be a entry with the directory to Python already)
  5. Click OK on all opened windows and Apply if allowed
  6. Restart your computer

If you need help finding your python directory, here is an article: https://datatofish.com/locate-python-windows/

Hope this helps!

  • Related