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
🌐
Redreamality
redreamality.com › blog › pythonpathvs-code
How to Set PYTHONPATH on Windows, Linux, macOS and VS Code
August 21, 2025 - To check if PYTHONPATH has been set correctly, you can execute the following in your terminal or command prompt: In Windows (cmd.exe): echo %PYTHONPATH% In Windows (PowerShell): $env:PYTHONPATH ·
Discussions

Echoing the windows path in python - Stack Overflow
Essentially what I am trying to do is from subprocess import call print call(['echo', '%path%']) however 'echo' is not recognized as an executable is there some kind of workaround? More on stackoverflow.com
🌐 stackoverflow.com
Python and the PATH variable in Windows 10
If you type python and the store opens, Turn off the python alias in the Alias List in settings ( https://www.tenforums.com/tutorials/102096-manage-app-execution-aliases-windows-10-a.html ) More on reddit.com
🌐 r/Python
16
33
August 20, 2021
Adding Python to PATH on Windows - Stack Overflow
Kill and reopen your shell window: ... the window you are testing it on. NO SPACES when setting the Variables. Make sure that you are adding the ;C:\Python27 WITHOUT any spaces. (It is common to try C:\SomeOther; C:\Python27 That space (␣) after the semicolon is not okay.) USE A BACKWARD SLASH when spelling out your full path. You will see forward slashes when you try echo $PATH but ... More on stackoverflow.com
🌐 stackoverflow.com
python - How to get the PYTHONPATH in shell? - Stack Overflow
How can I get all of PYTHONPATH output in bash? Why echo $PYTHONPATH can not get all of them? ... sys.path is not PYTHONPATH, sys.path actually consists of multiple things : current dir,PYTHONPATH,standard library, and paths contained in .pth files if any. More on stackoverflow.com
🌐 stackoverflow.com
People also ask

Is SYS path the same as Pythonpath?
The SYS path is a list of directories that Python interprets to search for when it starts up.  The Pythonpath is a list of directories that the Python interpreter will search for when it tries to resolve a module name.  So, both look the same but are quite different.
🌐
simplilearn.com
simplilearn.com › home › resources › software development › understanding the python path environment variable in python
Understanding the Python Path Environment Variable in Python [Updated]
How do I create a Pythonpath variable?
To create a Pythonpath variable, you will need to first open the Command Prompt.  Once the Command Prompt is open, you will need to type in the following command: setx /M Pythonpath "C:\Python27\Lib".  And you should know that creating a Pythonpath environment variable in Python will be changing depending on your operating system and whether you want the variable to be permanent. On Windows, you can use the set command to create a Pythonpath variable:set Pythonpath=C:\python On Mac or Linux, you can use the export command to create a Pythonpath variable:export Pythonpath =/usr/local/lib/python
🌐
simplilearn.com
simplilearn.com › home › resources › software development › understanding the python path environment variable in python
Understanding the Python Path Environment Variable in Python [Updated]
How do I add an environment variable in Pythonpath?
Following a few steps will allow you to add an environment variable: By setting the Pythonpath environment variable. By adding manually to the path in the file.  By using the os.environ module method.  Then you can also use the os.environ["key"] = "value" syntax to add a single environment variable.
🌐
simplilearn.com
simplilearn.com › home › resources › software development › understanding the python path environment variable in python
Understanding the Python Path Environment Variable in Python [Updated]
🌐
GitHub
bic-berkeley.github.io › psych-214-fall-2016 › using_pythonpath.html
Using PYTHONPATH — Functional MRI methods
Give the variable name as PYTHONPATH and the value is the path to the code directory. Choose OK and OK again to save this variable. Now open a cmd Window (Windows key, then type cmd and press Return). Type: echo %PYTHONPATH% to confirm the environment variable is correctly set.
🌐
Real Python
realpython.com › add-python-to-path
How to Add Python to PATH – Real Python
July 23, 2026 - Reordering PATH on Windows is relatively straightforward. You open the GUI control panel and adjust the order using the Move Up and Move Down buttons. If you’re on a UNIX-based operating system, however, the process is more involved. Read on to learn more. Usually, your first task when managing your PATH is to see what’s in there. To see the value of any environment variable in Linux or macOS, you can use the echo command:
🌐
Net Informations
net-informations.com › python › intro › path.htm
How to set python path
echo %PYTHONPATH% Now you can confirm the environment variable is correctly set. It's essential to differentiate between the PYTHONPATH environment variable and the Python PATH environment variable. The latter serves the purpose of aiding the operating system in locating executables from any location. For instance, if you enter "Python" in your Command Window, the system will consult the PATH variable to identify directories potentially housing the "python" executable.
🌐
Jss367
jss367.github.io › path-problems-windows.html
Path Problems: Windows | Julius’ Data Science Blog
January 31, 2020 - But it’s your Python path, not your system path, that it’s missing from. import my_module ModuleNotFoundError: No module named 'my_module' On Windows, if you echo $PYTHONPATH you get nothing, but you can use Python to see what’s in your path
Find elsewhere
🌐
docs.python.org
docs.python.org › 3 › using › windows.html
4. Using Python on Windows — Python 3.15.2 documentation
This is a convenience for Windows-only scripts, such as those generated by an installer, since the behavior is not compatible with Unix-style shells. These paths may be quoted, and may include multiple arguments, after which the path to the script and any additional arguments will be appended.
🌐
TutorialsPoint
tutorialspoint.com › How-to-set-python-environment-variable-PYTHONPATH-on-Windows
How to set Python environment variable PYTHONPATH on Linux?
May 2, 2023 - The colon (:) separates multiple paths on Linux. ... This displays the current PYTHONPATH value, showing all directories Python will search for modules. ... The export command only affects the current terminal session. For permanent setup, add the export command to your shell configuration file ? echo 'export PYTHONPATH=$PYTHONPATH:~/my_module' >> ~/.bashrc source ~/.bashrc
🌐
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
🌐
AskPython
askpython.com › python › built-in-methods › pythonpath-in-shell
How to Get the Pythonpath in Shell? - AskPython
3 weeks ago - Separate multiple directories with a colon on Linux or macOS, and use a semicolon on Windows. Python exposes the platform’s separator through os.pathsep, so this Bash example reports the delimiter and the number of configured entries.
🌐
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 - The Edit environment variable window contains a list of directories previously added to PATH. To add the Python entry: 1. Select the New button in the upper-right corner. A new blank entry appears in the list. 2. Paste the address from Step 1 into the entry and press Enter. 3. Move the address to the top of the list by pressing the Move Up button. ... 5. Ensure the PATH variable now contains the Python directory by using the echo command in PowerShell:
🌐
Ask Ubuntu
askubuntu.com › questions › 941919 › which-python-and-echo-pythonpath-give-different-directories-what-does-this
16.04 - 'which python' and 'echo PYTHONPATH' give different directories, what does this mean? - Ask Ubuntu
August 1, 2017 - The default search path is installation dependent, but generally begins with ${prefix}/lib/python<ver‐ sion> (see PYTHONHOME above). The default search path is always appended to $PYTHONPATH.
🌐
Reddit
reddit.com › r/python › python and the path variable in windows 10
r/Python on Reddit: Python and the PATH variable in Windows 10
August 20, 2021 -

Do you remember checking the box in the image shown below to add your Python installation to PATH in Windows 10?

Adding Python to PATH

Well, I was curious! What if someone accidentally forgot to check that little radio button? What would be the possible recovery steps?

So I spent my evening yesterday uninstalling Python and re-installing to figure out a way to add Python to the PATH post-installation.

If you forget to add Python to the PATH variable, you won't be able to run Python in your command line.

You will get a message saying,

‘python' is not recognized as an internal or external command.

Here are the steps I used to add Python to the PATH variable in Windows 10.

  1. Copy the directory to which Python is being installed.

  2. Search for System Properties in the Search Bar.

  3. Click on the "Environment Variables" button in System Properties.

  4. Click on the "Path" variable and then click on "Edit".

  5. Now here's the deal. Paste the directory path from Step 1 at the top of the list. You can use the "Move up" button to get it to the top. Now click on "Ok".

I found out that if you paste the path at the end, it still doesn't work. Can someone tell me why?

Anyways, if the steps are not clear to anyone, here is a visual guide containing images of every step, on my blog for achieving the above objective. If you are interested, do take a look.

🌐
YouTube
youtube.com › watch
PYTHONPATH Explained, How to Use PYTHONPATH | How to Python 1 | Python Tutorials - YouTube
In this video we’ll be go over how to set up your PYTHONPATH in a linux terminal and windows command prompt to be able to use GitHub repositories you’ve clon...
Published: October 7, 2021
Views: 8K
🌐
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 - Properly configure Python on your Windows machine by adding the Python path to the Windows 10 / 11 PATH environment variable, allowing your system to recognize and execute Python commands regardless of the current directory.Windows Operating System environment variable specifies the location of Python libraries, allowing Python to be readily accessible from any location within your system.
🌐
Reddit
reddit.com › r/learnprogramming › how can i inspect my windows 10 path variable.
r/learnprogramming on Reddit: How can I inspect my Windows 10 PATH variable.
September 4, 2021 -

I would like to know where I can access the contents of the Windows 10 PATH variable. For Example, the path to Python should already have been added to PATH. I know this because when I open cmd on Windows 10 and enter python the terminal shows the Python command prompt as expected. So I assume that the path to Python.exe has already been added to the PATH variable during installation. To confirm that the python path has actually been added to PATH, I simply went to

This PC -> Advanced System Settings -> Environment Variables

to inspect the PATH variable. The resulting view shows me a list with all the paths already added to PATH (and other variables). However, within this list, I can't find the installation path of Python. I double-checked my python installation-path via the command

python -c "import os, sys; print(os.path.dirname(sys.executable))"

However, I can't find the resulting path in the before mentioned list. How can I inspect the contents of my PATH variable such that I can see my Python path? Have I misunderstood something basic?