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
This classic method involves utilizing Windows' Command Prompt to find where Python is installed. Press Win + R to open the run window, type cmd, and press Enter. In the Command Prompt window, type the following command:
Discussions

Finding where 3.13 is installed
I installled 3.13 but can ONLY see the path in the windows path variable. The directory does not show up in the filesystem (either in C: or under users.\AppData. In python 3.3, 3.4, 3.6, 3.10, the install was much simplier and cleaner. More on discuss.python.org
๐ŸŒ discuss.python.org
0
0
October 25, 2024
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
Find where python is installed (if it isn't default dir) - Stack Overflow
Python is on my machine, I just don't know where, if I type python in terminal it will open Python 2.6.4, this isn't in it's default directory, there surely is a way of finding it's install locatio... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Why doesnt Python add itself to PATH on Windows?
A lot of people have many different versions of Python installed. Perhaps the installer doesn't want to assume that the one you're currently installing should automatically be the default one (by adding it to the path) More on reddit.com
๐ŸŒ r/Python
60
115
August 21, 2023
๐ŸŒ
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โ€ฆ
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ using โ€บ windows.html
4. Using Python on Windows โ€” Python 3.14.3 documentation
To emulate a per-machine install, you can use py install --target=<shared location> as administrator and add your own system-wide modifications to PATH, the registry, or the Start menu. When the MSIX is installed, but commands are not available in the PATH environment variable, they can be found under %LocalAppData%\Microsoft\WindowsApps\PythonSoftwareFoundation.PythonManager_3847v3x7pw1km or %LocalAppData%\Microsoft\WindowsApps\PythonSoftwareFoundation.PythonManager_qbz5n2kfra8p0, depending on whether it was installed from python.org or through the Windows Store.
๐ŸŒ
AskPython
askpython.com โ€บ home โ€บ finding where python is installed (when it isnโ€™t the default dir)
Finding Where Python Is Installed (when it isn't the default dir) - AskPython
April 10, 2025 - But where python returns the actual install location on disk. Also read: [Fix] Bash: Python3: command not found When Installing discord.py on Windows ยท Another method is using Pythonโ€™s built-in sys module to print the path to the currently running executable: ... So, if you have multiple Python versions installed (eg. Python 2.7, 3.7, 3.10 etc), sys.executable points to the specific executable.
๐ŸŒ
Quora
quora.com โ€บ Where-is-Python-installed-on-Windows
Where is Python installed on Windows? - Quora
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...
๐ŸŒ
Python.org
discuss.python.org โ€บ python help
Finding where 3.13 is installed - Python Help - Discussions on Python.org
October 25, 2024 - I installled 3.13 but can ONLY see the path in the windows path variable. The directory does not show up in the filesystem (either in C: or under users.\AppData. In python 3.3, 3.4, 3.6, 3.10, the install was much simplier and cleaner.
Find elsewhere
๐ŸŒ
Enterprise DNA
blog.enterprisedna.co โ€บ where-is-python-installed
Where is Python Installed? A Quick Guide โ€“ Master Data Skills + AI
By default, Python installations on Windows are located in the C:\ directory or C:\Users\<User>\AppData\Local\Programs. The common installation paths for both 32-bit and 64-bit versions may reside in the C:\PythonXX folder, where XX stands for the Python version (e.g., C:\Python27 for Python ...
๐ŸŒ
W3docs
w3docs.com โ€บ python
How can I find where Python is installed on Windows?
Click on the "New" button and enter the path to the Python installation. For example: C:\Python38\ Alternatively, you can use the where command in the command prompt to find the location of the Python executable.
๐ŸŒ
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
๐ŸŒ
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 can I find where Python is installed on Windows - YouTube
How can I find where Python is installed on WindowsWhere is Python installed on Windows
Published ย  May 5, 2019
๐ŸŒ
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 ย  1 week ago
๐ŸŒ
CodeRivers
coderivers.org โ€บ blog โ€บ where-is-python-installed-on-windows
Where is Python Installed on Windows: A Comprehensive Guide - CodeRivers
April 8, 2025 - pyenv global 3.8.10 # Set the global Python version cd C:\MyProject pyenv local 3.9.7 # Set the local Python version for the current project ยท System-wide Installation: If you are the only user on the system and need Python to be available for all users, you can install Python in a system-wide location like C:\PythonXY.
๐ŸŒ
Delft Stack
delftstack.com โ€บ home โ€บ howto โ€บ python โ€บ python default install location
Python Default Install Location | Delft Stack
March 11, 2025 - In this tutorial, we will explore the default installation location of Python on Windows, how to verify your installation, and how to manage your Python environment using Git commands.
๐ŸŒ
AskPython
askpython.com โ€บ home โ€บ determining the install path of python from the command line
Determining the Install Path of Python from the Command Line - AskPython
June 30, 2023 - In windows, go to your search bar, and write cmd or command prompt in it. 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.
๐ŸŒ
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 - Windows normally installs Python on one of the two locations: C:Python39 C:UsersYourUserAppDataLocalProgramsPythonPython39 For me, itโ€™s the latter. For you, it may be differentโ€”this article shows you how to check for yourself!
๐ŸŒ
Webucator
webucator.com โ€บ catalog โ€บ programming โ€บ python
How to find all your Python installations on Windows (and Mac) | Webucator
C:\> Get-ChildItem -Path C:\ -Filter site.py -Recurse -ErrorAction SilentlyContinue -Force Directory: C:\Program Files\MySQL\MySQL Workbench 8.0 CE\python\lib Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 9/16/2017 7:38 PM 19168 site.py Directory: C:\Users\ndunn\AppData\Local\Programs\Python\Python38\Lib Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 9/7/2020 11:16 PM 21963 site.py Directory: C:\Users\ndunn\AppData\Local\Programs\Python\Python39\Lib Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 6/28/2021 4:06 PM 22207 site.py
๐ŸŒ
Fmyly
en.fmyly.com โ€บ article โ€บ where-did-python-install-itself
Where Did Python Install Itself on Your Computer? - Fmyly
November 11, 2025 - C:\PythonXX: Less common nowadays, but older installers or manual installations might place it directly at the root of the C: drive. The easiest way to find out which Python executable your system is currently using is through the Command Prompt or PowerShell: Open Command Prompt/PowerShell: Type cmd or powershell in the Windows search bar and press Enter.