How to Add Python to PATH and Fix 'Python Not Recognized' Error

Introduction

Are you facing the 'python' not recognized error? Don’t worry! Let’s fix it by adding Python to your system PATH.

Locate Python Installation

First, find your Python installation directory. Typically, it’s in C:\Python39 or C:\Users\<YourUsername>\AppData\Local\ Programs\Python\Python39.

Open Environment Variables

Right-click on "This PC" or "My Computer." Select "Properties," then "Advanced system settings." Click on "Environment Variables."

Edit PATH Variable

In the "System variables" section, find and select the "Path" variable. Click "Edit," then "New." Add the path to your Python folder.

Verify the Changes

Open a new command prompt and type python --version. If you see the version number, you’ve successfully added Python to PATH!