Explain Codes LogoExplain Codes Logo

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings

python
environment-variables
pip
ide
Alex KataevbyAlex Kataev·Mar 3, 2025
TLDR

Fix the Python not found issue by updating your system's PATH.

  1. Find your Python installation directory (e.g., C:\Python38).

  2. Add Python's path to PATH:

    setx PATH "%PATH%;C:\Python38" # say hello to Python
  3. Don't forget the Scripts directory for our dear friend pip:

    setx PATH "%PATH%;C:\Python38\Scripts" # now 'pip' can join party

Remember to replace C:\Python38 with your actual Python installation directory!

Understanding the issue and solution

Let's take a journey into the foundation of the issue and its solution. You'll be an expert before you know it.

Verify Python is installed

First, let's confirm if Python is even on your system:

py --version # Python replies with its version, if it's there.

If no version number shows up, it can't come to the phone right now. Download and install from Python.org. Remember to check add Python to the PATH during the installation.

Environment variables check

Next, have a looksie at your environment variables (This PC > Properties > Advanced system settings > Environment Variables). Make sure Python’s paths are included under System variables > Path.

Managing aliases

Seeing a suggestion to install Python from the Microsoft Store? You'll need to disable those pesky App Installer aliases. Navigate to Settings > Apps > Apps & features > Manage App Execution Aliases and disable all the Python aliases.

System architecture: 32-bit or 64-bit?

Ensure your Python installation's architecture (32-bit or 64-bit) matches your system's. Mismatches could throw a rickety wrench into the works.

Integrated development environments (IDE) to the rescue

Consider using IDEs like PyCharm or Visual Studio Code. They play nice with environment configuration and are often less trouble.

Other roadblocks and their solutions

Let's gear up for other potential problems and their solutions.

Pip and package management

To safely work with packages:

python -m pip install --upgrade pip setuptools virtualenv # upgrading the team

Mind the system paths

When working with Environment Variables, remember to tread lightly and update accurately. Improper edits have potential to gnaw at your system.

When in doubt, visualise

Visual guides in the form of screenshots or videos are your friend. Utilize them.

Be patient, double-check

Always double-check your work and if trouble persists, turn to an experienced friend - Stackoverflow.