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?
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.