How can I find where Python is installed on Windows?

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

How can I find where Python is installed on Windows?

It would be either of

  • C:Python36
  • C:Users(Your logged in User)AppDataLocalProgramsPythonPython36

Leave a Reply

Your email address will not be published. Required fields are marked *