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
In the Command Prompt window, type the following command: ... Press Enter, and the system will display the paths where Python is installed.
Discussions

Quick Question: How do I view Python's location in command prompt?
Either via the command where from a cmd shell: where python Or via sys.executable from a Python shell: import sys sys.executable More on reddit.com
🌐 r/learnpython
4
1
November 11, 2021
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
windows - Where was python installed? - Stack Overflow
But in this case, the cli cannot ... to the PATH yet. Also, I looked closely in Windows file explorer and was not able to find Python in Program Files, Program Files (x86), the root of the C drive, or any of the many other places that I looked. Here are the commands that first install python and then try to check the resulting ... More on stackoverflow.com
🌐 stackoverflow.com
Find where python is installed (if it isn't default dir) - Stack Overflow
The equivalent in Windows Command ... in Windows Powershell. Another (cross-platform) method is to type this into IDLE or REPL (type python into your terminal): ... This will print the path to the re module, consequently showing you where the python command points to. You can put any other module that you know is installed, and the path ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
AskPython
askpython.com › python › examples › find-where-python-is-installed
Finding Where Python Is Installed (when it isn't the default dir) - AskPython
April 10, 2025 - There are several easy methods to find where Python is installed on Windows. Using the where command or checking Python’s sys path returns the location.
🌐
pythontutorials
pythontutorials.net › blog › how-can-i-find-where-python-is-installed-on-windows
How to Find Where Python is Installed on Windows: Step-by-Step Guide to Locate Python Installation Path — pythontutorials.net
Here’s how to find it in popular tools: Open IDLE (search for "IDLE" in the Start Menu). Go to File > Path Browser. A window will show the Python installation directory and libraries.
🌐
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
🌐
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…
Find elsewhere
🌐
Python
docs.python.org › 3 › using › windows.html
4. Using Python on Windows — Python 3.14.6 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:
🌐
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 - C:\Users\SHREYA\AppData\Local\Programs\Python\Python311\python.exe C:\Users\SHREYA\AppData\Local\Microsoft\WindowsApps\python.exe ... There is another way to locate your Python installation files using the command line.
🌐
Medium
medium.com › @anandbanshijha › 1-locate-the-python-executable-6212208c9ade
1. Locate the Python Executable. First, find where Python is installed… | by Anandbanshijha | Medium
February 20, 2026 - ... Open the Command Palette in VS Code by pressing Ctrl+Shift+P. Type Python: Select Interpreter and select the command. If your Python installation appears in the list, select it.
🌐
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.
🌐
W3docs
w3docs.com › python
How can I find where Python is installed on Windows? | W3Docs
This prints the path to the Python executable. If you have multiple versions of Python installed, the where command will show the location of all of them.
🌐
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
🌐
Quora
quora.com › Where-is-Python-installed-on-Windows
Where is Python installed on Windows? - Quora
Answer (1 of 7): As others say, Python is not a part of windows distribution. Moreover, there are multiple implementations of Python: CPython 2.7 installs into C:\users\ \Local Settings\Application Data\Programs\Python\Python27 CPython 3.6 - into C:\users\ \Local Settings\Application D...
🌐
sqlpey
sqlpey.com › python › top-10-ways-to-identify-your-python-installation-path-on-windows
Top 10 Ways to Identify Your Python Installation Path on Windows
December 5, 2024 - If the Python Launcher is installed (available from Python 3.3 onward), you can leverage it to list the installed paths: ... Installed Pythons found by Python Launcher for Windows -3.8-32 C:\Users\<YourUsername>\AppData\Local\Programs\Python\Python38-32\python.exe * -2.7-64 C:\Python27\python.exe
🌐
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 - That tells you the full path of the interpreter currently executing the command. It is often better than where python because it answers: ... For virtual environments, this is especially helpful. Windows often has the Python Launcher py, which can list registered interpreters: ... -V:3.12 C:\Users\you\AppData\Local\Programs\Python\Python312\python.exe -V:3.11 C:\Python311\python.exe · This is one of the best commands when several Python versions are installed and you want to see them all in one place.
🌐
Iditect
iditect.com › faq › python › how-to-find-where-python-is-installed-on-windows.html
How to find where Python is installed on Windows?
The default installation directory for Python on Windows is typically C:\PythonXX, where "XX" represents the version number. For example, if you have Python 3.9 installed, you can check C:\Python39 for the Python executable. You can browse this directory using the File Explorer to locate the ...