In your Python interpreter, type the following commands:

>>> import os, sys
>>> os.path.dirname(sys.executable)
'C:\\Python25'

Also, you can club all these and use a single line command. Open cmd and enter following command

python -c "import os, sys; print(os.path.dirname(sys.executable))"
Answer from elo80ka on Stack Overflow
🌐
CodeWithHarry
codewithharry.com › blogpost › how-to-find-python-installation-path
How to find the Python Installation Path on Windows? | Blog | CodeWithHarry
Press Enter, and the system will display the paths where Python is installed. The terminal is a powerful scripting environment and newer command-line shell, offering a more modern approach to interacting with your system. If you use the terminal, the following steps will help you find where Python is installed!
Discussions

cmd - How do I test if Python is installed on Windows (10), and run an exe to install it if its not installed? - Stack Overflow
I need to run the 2nd command on windows cmd only if the 1st one fails, in another scneario, I want to open python setup after checking if it is installed or not. I used this command python --v... More on stackoverflow.com
🌐 stackoverflow.com
Python Installation
Hello, I recently got python downloaded in my system. able to open all terminals, Idle windows able to access Pycharm. but really not sure where is the exact location of Python installed when i try to check from Command prompt. I wanted to add Environmental Variables. Please help. More on discuss.python.org
🌐 discuss.python.org
5
0
December 7, 2023
The absolute maze that is installing python and path variables
The official python (python.org) on Windows? The modern standard install on Windows does not use PATH at all anymore. Anyone telling you to use that is trying to make the modern install backwards compatible with the old-school way of doing things. Instead, python comes with the " python launcher ", which is the command "py". To run a file: py myfile.py To install a module: py -m pip install Etc. py is automatically associated with .py and .pyw files, so you can just doubleclick them to run as well. BUT WAIT, THERE'S A CATCH! The normal, proper way to develop python code is to make an isolated virtual environment for each project. If you do this it will activeate the old-school python and pip commands. So if you are working in a virtual environment To run a file: python myfile.py To install a module: pip install Note most good IDEs have the virtual environment management built in and often enabled by default. More on reddit.com
🌐 r/learnpython
99
209
January 28, 2022
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
🌐
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 - Screenshot by Idowu Omisola -- No attribution required · To see if Python is already added to the Windows PATH, open the terminal and type python --version, then hit the Enter key.
🌐
Python
docs.python.org › 3 › using › windows.html
4. Using Python on Windows — Python 3.15.2 documentation
System-wide installations of Python 3.3 and later will put the launcher on your PATH. The launcher is compatible with all available versions of Python, so it does not matter which version is installed. To check that the launcher is available, execute the following command in Command Prompt: ... You should find that the latest version of Python you have installed is started - it can be exited as normal, and any additional command-line arguments specified will be sent directly to Python. If you have multiple versions of Python installed (e.g., 3.7 and 3.15) you will have noticed that Python 3.15 was started - to launch Python 3.7, try the command:
🌐
YouTube
youtube.com › watch
How to Find Python Installation Path in Windows 10/11 (2023) - YouTube
In this video I'll show you how to find python installation path in windows 10 or windows 11. Python installation path by default is C:\Users\USERNAME\AppDat...
Published: November 20, 2023
🌐
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 - On the initial setup screen, check the box at the bottom labeled “Add Python [version] to PATH”. The following steps allow you to confirm whether Python is already in your Windows PATH variable.
Find elsewhere
🌐
CodeGenes
codegenes.net › blog › how-do-i-test-if-python-is-installed-on-windows-10-and-run-an-exe-to-install-it-if-its-not-installed
How to Check if Python is Installed on Windows 10 and Run the Installer EXE If Not: Fixing CMD || Command Issues — codegenes.net
The quickest way to check for Python is via Command Prompt. Here’s how: ... Press Win + R to open the “Run” dialog. ... Run Python Version Check Commands: In the CMD window, try one of these commands to check for Python:
🌐
Quora
quora.com › How-do-I-check-if-Python-is-installed-on-Windows-10
How to check if Python is installed on Windows 10 - Quora
Answer (1 of 18): Just go in cmd and type python if it installed it will open a prompt . Sometimes it may not work if environment variable is not set up, so you can also check by where python in cmd. If where python returns something hot to that path and see for python.exe
🌐
Python.org
discuss.python.org › python help
Python Installation - Python Help - Discussions on Python.org
December 7, 2023 - Hello, I recently got python downloaded in my system. able to open all terminals, Idle windows able to access Pycharm. but really not sure where is the exact location of Python installed when i try to check from Command…
🌐
AskPython
askpython.com › python › examples › find-where-python-is-installed
Where Is Python Installed? Find Its Path - AskPython
1 month ago - In Command Prompt, use the Windows where utility to search the current directory and PATH for matching command files. ... where.exe searches the current directory and PATH. Its output lists matching files from those search locations.
🌐
Great Learning
mygreatlearning.com › blog › it/software development › how to add python to path?
How To Add Python To Path?
November 15, 2024 - You have successfully added Python to the Path using the steps outlined above on how to set Python path in Windows. You can check if it has been added properly by writing the Python command in your command line. You will not get the same error ...
🌐
Geek University
geek-university.com › home › python online course › add python to path on windows
Add Python to PATH on Windows · Geek University
Reorder PATH entries if the wrong installation is selected, or use an explicit launcher version selector when you need a particular version. Close every Command Prompt window and open a new one. Confirm that python.exe exists in the directory you added. Make sure you added the containing folder, not python.exe itself. Check that the PATH edit was saved with OK in all dialogs.
🌐
AskPython
askpython.com › python › examples › determine-install-path-of-python-cli
Determining the Install Path of Python from the Command Line - AskPython
June 30, 2023 - Or, press windows key + R, and open “cmd”. ... Now we’ll run the following command in our command prompt to find the location of Python in our computer. ... Now press “Enter”. The keyword “where” will give you the absolute path ...
🌐
Finxter
blog.finxter.com › home › learn python blog › how to find path where python is installed on windows?
How to Find Path Where Python is Installed on Windows? - Be on the Right Side of Change
June 23, 2021 - To get the Python installation path on Windows without using either the Python interpreter or the command line, check the Windows registry that contains a key for each installed Python version.
🌐
Reddit
reddit.com › r/learnpython › the absolute maze that is installing python and path variables
r/learnpython on Reddit: The absolute maze that is installing python and path variables
January 28, 2022 -

I've installed python on 1 computer successfully after hours of reading stackoverflow suggestions, youtube videos, documentation etc. And after getting it on there and working I was so frustrated and lost that I had no idea what actions from which source actually worked.

Can someone walk me through this from step 1 why python never works after running the installer and needs all sorts of pointer adjustments in the PATH variable or X other variable like PYTHON PATH to places I can't even manage to keep track of? More specifically, today with a fresh install, what needs to be done to get python to actually install and be detectable by commands.

I'm obviously new, and mostly illiterate to the command prompt so that's part of my difficulty with going through stack overflow where answers 1 through 5 all do something completely different all in command prompt with various opaque arguments, hidden references, implied actions, implied paths etc.

🌐
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.

🌐
Codemia
codemia.io › home › knowledge hub › how can i find where python is installed on windows?
How can I find where Python is installed on Windows? | Codemia
September 23, 2025 - The most reliable commands are usually where python, py -0p, and python -c "import sys; print(sys.executable)". If python is on your PATH, this command shows which executables Windows will find:
🌐
Reddit
reddit.com › r/learnpython › quick question: how do i view python's location in command prompt?
r/learnpython on Reddit: Quick Question: How do I view Python's location in command prompt?
November 11, 2021 -

So I've been having trouble with Python and I want to know which installation I'm using (I have two user profiles on Windows, my old one and the one I made explicitly to code in, and they both have Python installed).

I tried looking it up, but it only led to this madness you see below:

    Microsoft Windows [Version 10.0.19043.1348]
    (c) Microsoft Corporation. All rights reserved.

    C:\Users\willi>!type python
    '!type' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Users\willi>type python
    The system cannot find the file specified.

    C:\Users\willi>type Python
    The system cannot find the file specified.

    C:\Users\willi>Python type
    Python: can't open file 'C:\Users\willi\type': [Errno 2] No such file or     directory

    C:\Users\willi>Python
    Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit     (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> python
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name 'python' is not defined
    >>> .quit
      File "<stdin>", line 1
        .quit
        ^
    SyntaxError: invalid syntax
    >>> quit
    Use quit() or Ctrl-Z plus Return to exit
    >>> quit()
    
    C:\Users\willi>python
    Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit     (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> !type Python
      File "<stdin>", line 1
        !type Python
        ^
    SyntaxError: invalid syntax
    >>> type
    <class 'type'>
    >>> type python
      File "<stdin>", line 1
        type python
         ^
    SyntaxError: invalid syntax
    >>> type Python
      File "<stdin>", line 1
        type Python
         ^
    SyntaxError: invalid syntax
    >>> type(Python)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name 'Python' is not defined
    >>>

How do I view Python's location in command prompt?

🌐
YouTube
youtube.com › watch
How to Find Python Installation Location in Windows (3 Easy Methods) 🐍 - YouTube
In this video, you will learn simple and easy methods to find the Python installation path on a Windows system. Knowing the Python location is useful when se...
Published: March 16, 2026