try opening up cmd and simply:

where python

By default, this searches your PATH for matches. More precisely:

Description: Displays the location of files that match the search pattern. By default, the search is done along the current directory and in the paths specified by the PATH environment variable.

Most windows python installers modify your PATH so this should find what doing python at the CLI will call.

Answer from roippi on Stack Overflow
🌐
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 - 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 of Python as shown below. 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.
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
How can I find where Python is installed on Windows? - Stack Overflow
I want to find out my Python installation path on Windows. For example: ... You should give more information. You know that Python is installed, but can you run Python or not? In my case, I didn't install it; various products may have installed it and I want to find out if it exists somewhere in the file system. Would the interpreter be called python.exe? I have no idea. ... Also, you can club all these and use a single line command... More on stackoverflow.com
🌐 stackoverflow.com
How do I find out my PYTHONPATH using Python? - Stack Overflow
How do I find out which directories are listed in my system’s PYTHONPATH variable, from within a Python script (or the interactive shell)? More on stackoverflow.com
🌐 stackoverflow.com
python - How to get the PYTHONPATH in shell? - Stack Overflow
debian@debian:~$ echo $PYTHONPATH /home/qiime/lib/: debian@debian:~$ python Python 2.7.3 (default, Jan 2 2013, 16:53:07) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "li... More on stackoverflow.com
🌐 stackoverflow.com
People also ask

How do I add PYTHONPATH inside a Python script?
Changing os.environ["PYTHONPATH"] changes the process environment and can affect child processes started afterwards. For an import in the running interpreter, add the intended directory to sys.path before importing, or install the package into that interpreter’s environment.
🌐
askpython.com
askpython.com › python › built-in-methods › pythonpath-in-shell
How to Get the Pythonpath in Shell? - AskPython
How do I find where Python installs packages?
Run the site module through the interpreter used by your program. On Windows use python -m site, and on macOS or Linux use python3 -m site.
🌐
askpython.com
askpython.com › python › examples › find-where-python-is-installed
Where Is Python Installed? Find Its Path - AskPython
How do I set multiple directories in PYTHONPATH?
Join directory paths with the operating system’s separator. It is a colon on Linux and macOS and a semicolon on Windows, and os.pathsep reports the appropriate character.
🌐
askpython.com
askpython.com › python › built-in-methods › pythonpath-in-shell
How to Get the Pythonpath in Shell? - AskPython
🌐
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 ... 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: ... 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 ...
🌐
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?

🌐
The Data Guy
blog.edgeventures.com › find-python-path
Find Python Path
April 3, 2026 - from command line : python c - "import sys, os; print(os.path.dirname(sys.executable))"
🌐
AskPython
askpython.com › python › examples › find-where-python-is-installed
Where Is Python Installed? Find Its Path - AskPython
1 month ago - A shell lookup answers which command your terminal can start. Inside a running Python process, sys.executable reports the executable path. An environment manager or integrated development environment (IDE) may choose a runtime separately from the shell, so check the environment that launches your program. Homebrew documents its prefixes. Other installers can place Python in different directories. The executable path names a file.
Find elsewhere
🌐
AskPython
askpython.com › python › built-in-methods › pythonpath-in-shell
How to Get the Pythonpath in Shell? - AskPython
1 month ago - Changing os.environ can affect a subsequently launched child process that inherits the environment. It cannot alter the parent shell, and the existing interpreter retains its initialized sys.path until your code changes that list. The Python command-line documentation specifies that -E ignores PYTHON environment variables and -I enables isolated mode.
🌐
CodeRivers
coderivers.org › blog › how-to-find-python-path
Finding the Python Path: A Comprehensive Guide - CodeRivers
February 22, 2026 - This will show the path to the python3 executable. The location of the executable can give you an indication of the associated Python environment and where the standard library is located. On Windows, the where command serves a similar purpose. You can use it to find the location of the Python ...
🌐
YouTube
youtube.com › watch
How to find python path in cmd - YouTube
find python path command line linuxpython location commandfind python install location windows 10find python path macfind python path ubuntucheck python path...
Published: June 27, 2023
🌐
Dummies
dummies.com › article › technology › programming-web-design › python › how-to-find-path-information-in-python-148336
How to Find Path Information in Python | dummies
December 28, 2021 - You see the Python Shell window appear. Type import sys and press Enter. Type for p in sys.path: print(p) in a new cell and click Run Cell · You see a listing of the path information, as shown in the figure below.
Author:
🌐
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 - To find the Python path or where Python is installed on windows, various functions are used, such as using the “where python” command in the cmd terminal, using system properties, etc.
🌐
Quora
quora.com › How-do-I-find-a-Python-path-in-Linux
How to find a Python path in Linux - Quora
Answer (1 of 5): This works with every executable - use the which command [code]$> which python3.9 [/code]If you are able to use the command ‘python3.9’ at the command line then the ‘which’ command above will tell you the path to that command. If you need to find the path from within ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-find-the-full-path-of-the-python-interpreter
How to find the full path of the Python interpreter? - GeeksforGeeks
May 28, 2024 - On Windows, you can use the where command in the Command Prompt to find the path of the Python interpreter.
🌐
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 - On Windows, the right way to find Python depends on whether you want the executable currently on your PATH, the interpreter launched by the Python Launcher, or the full installation directory of a specific environment. The most reliable commands are usually where python, py -0p, and python -c "import sys; print(sys.executable)".
🌐
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 - Alternatively, you can check your Python installation path in your Windows command-line by using the simple two-word command “where Python“. Here’s how this works on my Windows machine:
🌐
YouTube
youtube.com › dylan codes
Python PATH Variable | How to run Python from command line EASY - YouTube
In this video, I will show you how to setup a Python PATH environment variable on Windows 10. After this, you will be able to run scripts from the command li...
Published: June 16, 2020
Views: 1K