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)

Here is an example of a path structure that you may get:

C:\Users\Ron\AppData\Local\Programs\Python\Python39

Manually Locate Where Python is Installed

Alternatively, you can manually locate where Python is installed by following these steps:

  1. Type ‘Python’ in the Windows Search Bar
  2. Right-click on the Python App, and then select “Open file location
  3. Right-click on the Python shortcut, and then select Properties
  4. Click on “Open File Location

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

C:\Users\Ron\AppData\Local\Programs\Python\Python39

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.