Languages

Python - was not found while trying to check version

1 points
Asked by:
Dirask Community
5850

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:
Dirask Community
5850

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