You know what has worked for me really well on windows.

My Computer > Properties > Advanced System Settings > Environment Variables >

Just add the path as C:\Python27 (or wherever you installed python)

OR

Then under system variables I create a new Variable called PythonPath. In this variable I have C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\other-folders-on-the-path

This is the best way that has worked for me which I hadn't found in any of the docs offered.

EDIT: For those who are not able to get it, Please add

C:\Python27;

along with it. Else it will never work.

Answer from darren on Stack Overflow
🌐
Real Python
realpython.com › add-python-to-path
How to Add Python to PATH – Real Python
July 23, 2026 - The quick fix for this is just adding your new Python directory before the old Python directory, though you’d probably want to clean your system of the bad Python installation too. Toggle between prepending and appending your Python directory below, and watch the shell stop at the very first match: Interactive diagram — enable JavaScript to view. Reordering PATH on Windows is relatively straightforward.
🌐
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 - When a user types a terminal command ... any of the directories, the system executes it. Use Windows System Properties to add Python's installation directory to the PATH variable....
🌐
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".
🌐
Python
docs.python.org › 3 › using › windows.html
4. Using Python on Windows — Python 3.15.2 documentation
To install the file downloaded from python.org, either double-click and select “Install”, or run Add-AppxPackage <path to MSIX> in Windows PowerShell. After installation, the python, py, and pymanager commands should be available.
🌐
Data to Fish
datatofish.com › add-python-to-windows-path
How to Add Python to Windows PATH
You can easily add Python to Windows PATH by downloading a recent version of Python and then checking the Add python.exe to PATH box at the bottom of the setup screen:
🌐
Geek University
geek-university.com › home › python online course › add python to path on windows
Add Python to PATH on Windows · Geek University
Enter the directory containing python.exe, for example C:\Python34. Confirm with OK in each open dialog so the change is saved. Current Windows editors display PATH entries as separate rows. Older interfaces may show one long value; in that case, separate directory entries with a semicolon (;). Do not delete or replace the existing PATH value. Add Python as another entry.
Find elsewhere
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › add package, directory to pythonpath in windows?
Add Package, Directory to PYTHONPATH in Windows? - Spark By {Examples}
May 31, 2024 - What is PYTHONPATH in Python and how to add to it in Windows? You may need to use a custom module or package that is not included in the standard library.
🌐
YouTube
youtube.com › watch
How To Add Python to PATH in Windows - YouTube
The tutorial explains how to add Python to the Windows PATH in two different ways, allowing users to run Python scripts and access Python packages directly f...
Published: September 28, 2024
🌐
Great Learning
mygreatlearning.com › blog › it/software development › how to add python to path?
How To Add Python To Path?
November 15, 2024 - This list of directories is stored in a variable called Path. Here's a step-by-step guide on how to add Python to the system path: First, locate where Python is installed on your computer. This varies depending on your operating system. For example: Windows: Typically installed in C:PythonXX (where XX is the version number).
🌐
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 full installation path to your Python installation with Scripts added to the end of it. In our example, we are using: C:UsersAdministratorAppDataLocalProgramsPythonPython313Scripts · Check the path again using the method listed above to verify the installation. PATH order determines which executable file you access first after entering a command. How it works: When you run a command in Command Prompt/ PowerShell, Windows scans through the directories listed in PATH – from top to bottom attempting to find a matching executable, running the first one that matters.
🌐
Net Informations
net-informations.com › python › intro › path.htm
How to set python path
For instance, if you enter "Python" ... Python to the PATH environment variable, follow these steps: Open the command prompt (Windows), or terminal (macOS, Linux) and navigate to the Python installation directory....
🌐
YouTube
youtube.com › rajarshi chattopadhyay
How to ADD FOLDERS to PYTHON PATH - Calling modules from anywhere in your PC - IMPORT ERROR - SOLVED - YouTube
This video demonstrates how to add any folder o your Windows 10 PC to the Python path. This makes calling your custom made modules easier and from anywhere i...
Published: July 2, 2019
Views: 2K
🌐
Geek University
geek-university.com › home › topic index › add python to the windows path
Add Python to the Windows PATH · Geek University
Enter sysdm.cpl and press Enter. This opens System Properties. Open the Advanced tab and select Environment Variables. In User variables, select Path for a per-user setup. Select the Path entry under System variables only when a machine-wide change is required.
🌐
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.
🌐
YouTube
youtube.com › watch
How to Add Python to PATH on Windows (Step-by-Step Guide) - YouTube
Learn how to manually add Python to the PATH on Windows. This lets you run Python and pip from the command prompt. Step-by-step instructions show how to loca...
Published: March 18, 2026
🌐
GitHub
bic-berkeley.github.io › psych-214-fall-2016 › using_pythonpath.html
Using PYTHONPATH — Functional MRI methods
For example, let’s say I wanted add the directory /Users/my_user/code to the PYTHONPATH: ... Open the file ~/.bash_profile in your text editor – e.g. atom ~/.bash_profile; ... Save the file. ... It should show something like /Users/my_user/code. ... Open the file ~/.bashrc in your text editor – e.g. atom ~/.bashrc; ... Save the file. ... It should show something like /home/my_user/code. Got to the Windows menu, right-click on “Computer” and select “Properties”:
🌐
YouTube
youtube.com › watch
Adding Python to PATH: Understanding What PATH Is & Adding Python to PATH on Windows - YouTube
Download your free Python Cheat Sheet here: https://realpython.com/cheatsheetFree Python Skill Test with instant level + learning plan: https://realpython.co
Published: April 2, 2026