he term 'python' is not recognized as the name of a cmdlet


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

PS C:UsersHesamDesktopcloud> python src/stats.py --chat_json C:UsersHesamDesktopchat exresult.json --output_dir C:UsersHesamDesktopres.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

Asked By: Hesam Hakemi



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:UsersHesamDesktopchat exresult.json –output_dir C:UsersHesamDesktopres.png

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}AppDataLocalProgramsPythonPython{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!

Answered By: jinn