python was not found error

Fix Python was not found error in Windows 11

Recently one user encountered an error while running Python code in VScode, he received the following error “Python was not found” error, If you are receiving a similar error, Don’t worry, we’ve got you covered! In this article, we will walk you through the step-by-step process to fix this error and get your Python interpreter up and running smoothly on your Windows 11 system.

Understanding Python was not found error

When you encounter the “Python was not found” error, it means that Windows 11 is unable to locate the Python executable file in its default system directories. This issue commonly occurs when the Python installation is not properly configured or the system environment variables are not set up correctly. you’ll receive the following full error message.

“Python was not found but can be installed from the Microsoft Store: htttps://go.microsoft.com/fwlink?linkID=2082640”

Possible causes of the Python was not found error:

There are several reasons, that could cause Python was not found error message:

  • Incorrect Python installation
  • Missing or misconfigured system environment variables
  • Corrupted Python installation files
  • Issues with the PATH variable

Steps to fix the Python was not found error in Windows 11

Step 1: Verify Python installation

First, make sure Python is installed properly on your Windows 11 system. Follow these steps:

Open the Command Prompt by pressing Windows + R and typing cmd. Press Enter.

In the Command Prompt window, type python and press Enter.

If Python is installed correctly, you should see the Python version and interpreter prompt displayed.

Python was not found-check the python version

If Python is not installed or the command is not recognized, proceed to the next step.

Step 2: Install Python

If you don’t have Python installed on your Windows 11 system, you’ll need to download and install the latest version. Follow these steps:

Visit the official Python website (https://www.python.org)

Navigate to the Downloads section and click on the latest version of Python for Windows.

Download the installer based on your system architecture (32-bit or 64-bit).

Run the installer and follow the on-screen instructions to complete the installation.

Step 3: Set up system environment variables

Setting up the system environment variables correctly is crucial for Windows 11 to locate the Python executable. Mostly this error occurs due to this reason, Follow these steps to configure the environment variables:

Open the Run command by pressing Windows + R and type sysdm.cpl and hit enter, this command will open the System Properties Window.

Click on the Advanced tab and Click on Environment Variables.

Environment Variables

Under System Variables, click on Path and choose Edit.

add Python to System Environment Variables

Under Edit Environment Variable, click on New and add the python path.

add Python to System Environment Variables

If you don’t know the path, just search for Python in Windows Search and right-click on the Python exe, and choose Open File location. This will take you to the Python Shortcut path, again right click on the Python shortcut and choose Open file location and now you’ll get the actual python path. Copy the Python path from the address bar.

Python folder path

Copy the path and add the path to the environment variable. Click on Ok.

Step 4: Verify Python installation again

After setting up the environment variables, we need to verify whether Windows 11 can now find the Python executable. Open the command prompt and check the python version by typing the command python –version. If Python is installed correctly and the environment variables are set up properly, you should no longer see the “Python was not found” error.

If you are using VScode, close and reopen the VScode to make the changes effective.

The “Python was not found” error in Windows 11 can be frustrating, but by following the steps outlined in this article, you should be able to resolve the issue quickly. Remember to carefully verify your Python installation, set up the environment variables correctly, and double-check your system configurations.

Read Also:

Fix Python command open Microsoft store in Windows 11/10

Fix No Python installation was detected in Windows 11/10

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top