How to check the Python installation path in Windows
In Download and Install (Win), we found that Windows users primarily install Python in two ways
- Installing from the MS Store
- Installing from the official Python installer
In this post, I will show you how to check the Python installation path for the above two methods.
1. MS Store: Checking the Python installation path
When you install Python from the MS Store, it is installed in two paths at the same time. One is where it is actually installed, and the other is where the shortcut files are installed. The actual installation folder is strictly restricted, and users can run Python from the shortcut file.
1.1. Shortcut file installation path
This path can be found using the following CMD command.
where python
The result of the execution:
1.2. Actual installation path
If we look at the CMD window that we opened by clicking the Open button in the MS Store, we can immediately see where the Python program is actually installed. Let's navigate to this folder using Explorer.
The WindowsApps folder in the middle of the path has strict permissions by default. So we need to change the permissions part, so don't follow along, just watch. The WindowsApps folder under Program Files is a hidden folder, so you can see it in the Hidden Items view like this
And to get inside the folder, we need to get the appropriate permissions. The easiest way to do this is Folder Properties > Security Tab > Advanced > Change Owner > Verify Name and Confirm Owner Selection.
After this process, you can see the Python programs in the folder as shown below.
2. Official installer: Verifying the Python installation path
There are three ways to check the Python installation path of the official installer
- Using the GUI only
- Using the Command Prompt (CMD)
- Using PowerShell
Let's look at them one at a time.
2.1. GUI Only Verification Method
This is a GUI-only method.
Right-click the Python entry in the Start menu, and then click Open File Location.
In the opening folder, open the Python executable properties window.
The Target entry tells you the path to the installation.
2.2. Command Prompt (CMD) Verification Method
The command to find the path to the Python executable in CMD is as follows.
where python
Result of execution:
The first method also displays the path to the python installed from the MS Store.
2.3. How to check using PowerShell
The command to find the path to the Python executable in PowerShell is as follows
Get-Command python
The result of the run:
If you are using a Unix-like shell such as Git bash or WSL, you can do the same as for Mac OS
3. Conclusion
So far we've seen how to determine the Python installation path on Windows. Hopefully this will help you in a situation where you need to know the installation location.
