Languages

Python - was not found while trying to check version

1 points
Asked by:
Haris65
386

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:
Haris65
386

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.
1 comments
Root-ssh
At least you can run Python script with C:\Users\YourUserName\AppData\Local\Programs\Python\Python39\my-script.py
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.

❤️💻 🙂

Join