How can I find where Python is installed on Windows? How can I find where Python is installed on Windows? python python

How can I find where Python is installed on Windows?


In your Python interpreter, type the following commands:

>>> import os>>> import sys>>> os.path.dirname(sys.executable)'C:\\Python25'

Also, you can club all these and use a single line command. Open cmd and enter following command

python -c "import os, sys; print(os.path.dirname(sys.executable))"


If you have Python in your environment variable then you can use the following command in cmd or powershell:

 where.exe python

or for Unix enviroment

 which python

command line image :

enter image description here


It would be either of

  • C:\Python36
  • C:\Users\(Your logged in User)\AppData\Local\Programs\Python\Python36