For Windows 10/8/7:

  1. Open System Properties (Right click Computer in the start menu, or use the keyboard shortcut Win+Pause)
  2. Click Advanced system settings in the sidebar.
  3. Click Environment Variables...
  4. Select PATH in the System variables section
  5. Click Edit
  6. Add Python's path to the end of the list (the paths are separated by semicolons). For example:

    C:\Windows;C:\Windows\System32;C:\Python27
    

For Windows XP:

  1. Open System Properties (Type it in the start menu, or use the keyboard shortcut Win+Pause)
  2. Switch to the Advanced tab
  3. Click Environment Variables...
  4. Select PATH in the System variables section
  5. Click Edit
  6. Add Python's path to the end of the list (the paths are separated by semicolons). For example:

    C:\Windows;C:\Windows\System32;C:\Python27
    
  7. Test on a new terminal window or if using an integrated terminal within a text editor, close and restart your editor or the changes won't be applied.

Answer from Michael Mrozek on Stack Exchange
🌐
Liquid Web
liquidweb.com › home › help docs › server administration › windows server administration › adding python path to windows 10 or 11 path environment variable
Adding Python Path to Windows 10 or 11 PATH Environment Variable | Liquid Web
December 15, 2025 - Type in the following and press Enter. ... In the System Properties window, go to the Advanced tab, clicking the Environment Variables button. Create a user variable by clicking the New button under the User Variables for Administrators section.
🌐
AccuWeb Hosting
manage.accuwebhosting.com › portal home › knowledgebase › windows vps hosting › how to add python path to windows environment variables?
How to Add Python Path to Windows Environment Variables? - AccuWebHosting
March 28, 2025 - That happens with the help of the PATH variable. It is essential to ensure that Python is accessible from any location within your system. Achieving this requires adding the Windows 10 or 11 PATH environment variable, allowing your system to recognize and execute Python commands without caring for the current directory.
🌐
Python
docs.python.org › 3 › using › windows.html
4. Using Python on Windows — Python 3.15.2 documentation
The /usr/bin/env form of shebang line will also search the PATH environment variable for unrecognized commands. This corresponds to the behaviour of the Unix env program, which performs the same search, but prefers launching known Python commands. A warning may be displayed when searching for arbitrary executables, and this search may be disabled by the shebang_can_run_anything configuration option. Shebang lines that do not match any of the patterns are treated as Windows executable paths that are absolute or relative to the directory containing the script file.
🌐
AllThings
allthings.how › all things how › windows › how to add python to path on windows 11
How to add Python to PATH on Windows 11
March 7, 2025 - In the Environment Variables window, under the User variables section, select the variable named Path and click Edit. If you don’t see a Path variable, click New and create one named Path.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-add-python-to-windows-path
How to add Python to Windows PATH? - GeeksforGeeks
July 12, 2025 - Click on open file location and you will be in a location where Python is installed, Copy the location path from the top by clicking over it. Now, we have to add the above-copied path as a variable so that windows can recognize. Search for "Environmental Variables", you will see something like this:
🌐
The Coder World
thecoderworld.com › home › windows › how to add python to path environment variable on windows 11
How to Add Python to PATH Environment Variable on Windows 11 - thecoderworld
April 22, 2026 - If it’s missing, Windows can’t locate the Python executable, which leads to errors when you try to run Python scripts, use pip, or activate virtual environments from the Command Prompt or PowerShell. If Python isn’t added to the PATH, you may see an error like this: “python is not recognized as an internal or external command, operable program or batch file.” · When you run a Python command, Windows searches for the executable using the system PATH variable.
Find elsewhere
🌐
Real Python
realpython.com › add-python-to-path
How to Add Python to PATH – Real Python
July 23, 2026 - There you’ll see User and System variables, which you’ll be able to edit: In the section entitled User Variables, double-click on the entry that says Path. Another window will pop up showing a list of paths.
🌐
Data to Fish
datatofish.com › add-python-to-windows-path
How to Add Python to Windows PATH
... Click on New... if no Path variable is present, Otherwise select the Path variable and then click on Edit… instead. You should then see the New User Variable box. Type Path in the Variable name field. For the Variable value you will need to know the path to the Python that is installed ...
🌐
Educative
educative.io › answers › how-to-add-python-to-path-variable-in-windows
How to add Python to PATH variable in Windows
A typical installation would have the following path, C:\Users\MyUserName\AppData\Local\Programs\Python\Python310 · Now, we will need to add this to the PATH variable, we right click on "This PC" and go to "Properties". Then, we click on the "Advanced system settings" in the menu on the left.going · In the bottom right, we can see a button labeled "Environment Variables". We will click on it to open another window to edit these variables.
🌐
Simplilearn
simplilearn.com › home › resources › software development › understanding the python path environment variable in python
Understanding the Python Path Environment Variable in Python [Updated]
September 14, 2025 - Python path is an environment variable used to maintain directories of custom Python libraries. Learn how to set a python path variable on Windows and Mac now!
Address: 5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to add python to path on windows, linux, and mac
How to Add Python to PATH on Windows, Linux, and Mac
December 12, 2025 - By default, Python is in the Python[version-number] directory located at: ... Note: AppData is a hidden directory. To access it, enable the Show Hidden Files option in File Explorer. Follow the steps below to find and copy the directory address: ... The options to modify the contents of the PATH variable are in the Environment Variables section of Windows System Properties.
🌐
Great Learning
mygreatlearning.com › blog › it/software development › how to add python to path?
How To Add Python To Path?
November 15, 2024 - In the "System Properties" window, click on "Environment Variables." macOS and Linux: Open a terminal window. In the "Environment Variables" window (Windows) or terminal (macOS/Linux), find the "Path" variable under the "System variables" section.
🌐
MakeUseOf
makeuseof.com › home › programming › how to add python to the windows path variable
How to Add Python to the Windows PATH variable
October 13, 2020 - Next, in the Variable name form, type Path, and paste your Python path in the Variable value field. Go back to your Python installation path folder and double-click on Scripts to open that directory.
🌐
Machine Learning Plus
machinelearningplus.com › blog › add python to path – how to add python to the path environment variable in windows?
add Python to PATH - How to add Python to the PATH environment variable in Windows? | MLPlus
March 23, 2023 - Step 7. In the “Edit environment variable” dialog, click on the “New” button, and paste the Python installation directory path that you copied in step 2. Repeat this step to add the \Scripts subdirectory path as well. Step 8. Click “OK” to close the “Edit environment variable” dialog, “OK” again to close the “Environment Variables” dialog, and one last “OK” to close the “System Properties” dialog. Step 9. Restart any open command prompt windows, or open a new one.
🌐
Windows Forum
windowsforum.com › home › tutorials
Set Up Windows PATH & Environment Variables for CLI Tools
May 17, 2026 - The command-line tool already installed, or at least know the folder path where its executable file is located. ... C:\Program Files\Git\cmd C:\Program Files\nodejs C:\Python312 C:\Users\YourName\AppData\Local\Programs\Python\Python312 C:\ffmpeg\bin
🌐
GeeksforGeeks
geeksforgeeks.org › python › pythonpath-environment-variable-in-python
PYTHONPATH Environment Variable in Python - GeeksforGeeks
January 9, 2026 - So to set PYTHONPATH on a windowsmachine follow the below steps: Step 1: Open your This PC (or My Computer) and right click on properties. Step 2: After the properties window pop up click on Advanced System Settings.
🌐
Help Desk Geek
helpdeskgeek.com › home › how-to › how to add to the windows path environment variable in windows 11 and 10
How to Add to the Windows PATH Environment Variable in Windows 11 and 10
September 26, 2017 - “‘python’ is not recognized as an internal or external command, operable program or batch file” means Windows can’t find the program’s executable. Adding its folder to the Windows PATH environment variable usually fixes this on Windows 11 and 10.