How to Find Where Python is Installed on Windows

In this short guide, you’ll see two methods to find where Python is installed on Windows:

Use the Sys Library to Find Where Python is Installed on Windows

You can use the sys library in order to find where Python is installed:

import sys

locate_python = sys.exec_prefix
print(locate_python)

For example, I got the following path when I ran the syntax in Python:

Manually Locate Where Python is Installed

Alternatively, you can manually locate where Python is installed by typing ‘Python’ in the Windows Search Bar:

How to Find Where Python is Installed on Windows

Right-click on the Python App, and then select “Open file location” as captured below:

Find Where Python is Installed on Windows

Right-click on the Python shortcut, and then select Properties:

How to Find Where Python is Installed on Windows

Click on “Open File Location“:

Open File Location

You’ll now get the location/path where your Python is installed on Windows:

Example of a Path

Notice that the path under this method matches to the path found under the first method.

Once you retrieved the above path, you’ll be able to upgrade pip for example.