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
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
🌐
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:
🌐
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?

🌐
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.
🌐
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 ...
Find elsewhere
🌐
W3docs
w3docs.com › home › code snippets › python › how can i find where python is installed on windows?
How can I find where Python is installed on Windows? | W3docs
If you have multiple versions of Python installed, the where command will show the location of all of them. You can specify a specific version of Python by including the version number in the command: ... This prints the path to the Python 3.8 ...
🌐
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
🌐
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…
🌐
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
🌐
Its Linux FOSS
itslinuxfoss.com › home › python › how to find where python is installed on windows?
How to Find Where Python is Installed on Windows? – Its Linux FOSS
March 27, 2023 - The easiest way to find where Python is installed on windows is using “where python” command in cmd terminal: ... The above snippet shows the path of the installed Python.
🌐
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:
🌐
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.
🌐
Net Informations
net-informations.com › python › intro › path.htm
How to set python path
If you still get the Python is not recognized as an internal or external command, operable program or batch file error, there is something wrong with your Path variable settings . Moreover, you will have to reopen all command prompt windows in order for changes to the Path variable take effect.
🌐
YouTube
youtube.com › watch
Find python path - Locate python install location - YouTube
When you have multiple Python installations, it can be confusing to figure out which Python your program is currently using, and how to locate its installati...
Published: July 30, 2019
🌐
LaptopJudge
laptopjudge.com › windows-python-path-locate-which-executable
Windows Python Path: Locate Which Executable (cli Check)
3 weeks ago - To find which Python executable Windows actually runs, check from the same terminal where the problem occurs. Use python -c "import sys; print(sys.executable)" to confirm the selected interpreter, then compare it with where.exe python, PowerShell’s Get-Command, and py -0p. Correct PATH or an app alias only after you identify the mismatch.
🌐
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.
🌐
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 - If the command returns the currently installed version of Python, it means you've successfully added it to the Windows PATH. However, to check if you've added the Scripts directory to the Windows PATH, try to run pip install package on the terminal, replacing "package" with your preferred library.
🌐
Geek University
geek-university.com › home › python online course › add python to path on windows
Add Python to PATH on Windows · Geek University
The correct PATH entry is the folder containing python.exe, such as C:\Python34; do not add the executable filename itself. Installation locations vary according to the Python version, installer choices, Windows account, and whether Python was installed for one user or for all users. Check the folder selected during installation, or search for python.exe in File Explorer...