System Environment Variable is the place where the windows store the path variables. The Path variable is a list of directories where each directory contains the executable file for a command. The Path variable is a well-known system environment variable and it exists on Windows, Mac, and Linux. Once you added any program path to the Path variable, then you can access it via Command prompt or run command without specifying an absolute path. When you entered any program command in the command prompt, the prompt searches in the Path variable for an executable file with the same name as the command, if the path is not found then you’ll receive the following error.
‘Python’ is not recognized as an internal or external command, operable program or batch file.
To overcome this error is to add the file’s directory path to the Path Variable, if you are facing this error after installing Python then the python path is not added to System Environment Variable. This article will guide you to add Python to System Environment Variables in Windows 11.
Add Python to System Environment Variables:
In Windows 11 you can add a Python path to the PATH variable using two different methods. Follow the below-mentioned methods to add python to the local env PATH variable.
Using Python Exe file:
Download the latest version of the Python exe file and open the exe file.
Now you’ll get the Python Setup Wizard, Check Add Python to the path. Then click on Install.
That’s it after the installation you no need to add the Python path manually, Open the Command Prompt and type Python –version to verify it.
If you get the python version in the command prompt, then the path is added successfully.
Using System Properties:
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.
Under System Variables, click on Path and choose Edit.
Under Edit Environment Variable, click on New and add the python path.
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.
Copy the path and add the path to the environment variable. Click on Ok.
Next Open the command prompt and check the python version by typing the command python –version.
Read Also:
Fix nvm you do not have sufficient privilege to perform this operation error in Windows 11/10
Fix “pip not recognized as internal or external command” Error in Windows 11