How to find the Python Installation Path on Windows?

How to find the Python Installation Path on Windows?

How to Find the Python Installation Path on Windows

Discover how to locate the Python installation path on your Windows system using two effective methods: the traditional Command Prompt and the modern Terminal. Whether you're troubleshooting or setting up environment variables, this guide provides clear, step-by-step instructions with visuals to help you find the information you need. Explore now!

  • By: Talha Shahid Khan

Locating the installation path of Python on your Windows system is essential for various tasks such as setting up environment variables or troubleshooting issues. In this guide, I will show you two methods to help you find the Python installation path: first using the traditional Command Prompt (CMD), and second using the newer Terminal (PowerShell).


Method 1: Using Command Prompt (CMD)

This classic method involves utilizing Windows' Command Prompt to find where Python is installed.

Step 1: Open Command Prompt

  1. Press <kbd>Win</kbd> + <kbd>R</kbd> to open the Run dialog.
  2. Type cmd and press <kbd>Enter</kbd>.

Step 2: Use the where Command

In the Command Prompt window, type the following command:

where python

Press <kbd>Enter</kbd>, and the system will display the paths where Python is installed.


Method 2: Using Terminal

The Windows Terminal is a powerful scripting environment and newer command-line shell, offering a modern approach to interacting with your system. If you prefer using Terminal, follow the steps below:

Step 1: Open Terminal

Search for Terminal in the Start menu and select it to launch.

Step 2: Use the Get-Command Command

In the Terminal window (PowerShell profile), type the following command:

(Get-Command python).Path

Press <kbd>Enter</kbd>, and Terminal will reveal the path where Python is currently resolved and installed.


Conclusion

Both the Command Prompt and Terminal methods are quick and effective ways to find the Python installation path on your Windows system. While Command Prompt is familiar and classic, Terminal offers a modern and powerful alternative.

Whether you are troubleshooting an issue, adding Python to your system PATH, or configuring IDEs, these two commands give you the precise information you need.

Feel free to drop a comment below if you have any questions or require further assistance.

Happy coding!