Python - was not found while trying to check version

1 points
Asked by:

A few days ago I installed Python. Today, I was trying to check its version using python --version command in cmd and I got this error:

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

Does anyone know how to solve this?

1 answer
0 points
Answered by:

The solution I found:

1. add Python to the Path environment variable:

  • click Start or press Windows button on the keyboard,
  • go to the Edit the system environment variables,
  • click Environment variables... on the bottom right,
  • in System Variables choose Path -> Edit -> New,
  • paste the path of your Python folder (e.g D:\Users\YourUserName\AppData\Local\Programs\Python\Python39),
  • optionally paste the path of the Scripts folder inside too.

2. If the above solution didn't help try this:

  • go to the Start -> Settings -> Apps & features,
  • open App execution aliases,
  • turn off python.exe.
At least you can run Python script with C:\Users\YourUserName\AppData\Local\Programs\Python\Python39\
Add comment
Native Advertising
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂