If you are unable to find Python being installed on your Windows (10/11) operating system and wondering how to locate the folder, well there are a few things that you can try.
Option 1: Make use of the where command
If you make use of the Command Prompt or PowerShell you can try to make use of the where command.
The where command can be used to display the location of files that match the given search pattern.
Example:C:/> where python
C:/> C:\Users\Code2care\AppData\Local\Programs\Python\Python39-32\python-exe
Option 2: Using the which command
If you make use of bash or git bash on Windows, you can try the which command.
# man witch
which – locate a program file in the user's path
Example:
which python
Oprion 3: Using Python code
This may sound funny, but you can write your own Python script or execute code snippets to find out the location of your Python installation on your Windows device using the os module.
Example:>>> import os
>>> import sys
>>> os.path.dirname(sys.executable)
'C:\Users\Code2care\AppData\Local\Programs\Python\Python39-32\python-exe'
Option 4: Check the Environment Variables
Python is often added to the system's PATH environment variable during installation. You can check if the Python installation directory is listed in the PATH variable by following these steps,
- Go to Start menu and search for "Environment Variables"
- Click on "Edit the system environment variables" option.
- In System Properties -> "Environment Variables" button.
- Look for Path under "System variables"
- Click edit and check if the Python installation directory is included.
Option 6: Search Manually
Most commonly Python setup is installed under C: drive "Program Files" or "Program Files (x86)" based on 32/64 bit versions. You can try to go to this location and try to find out.
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!