0

On windows 10 I have python installed and working, but not in the standard place C:\PythonXY.

How to find out the location of the python installation?

Alex
  • 34,021
  • 64
  • 178
  • 371

2 Answers2

5

You can do this:

>>> import sys
>>> sys.executable
C:\Python35\python.exe
Andy
  • 43,170
  • 54
  • 150
  • 214
  • 1
    This answer (or `sys.prefix`) is more generally useful for a novice that may only know how to run IDLE from the start menu. Possibly they need to know where Python is to add the directory to `PATH`, in which case where.exe will be useless. – Eryk Sun Apr 21 '16 at 18:30
3

Run where python in a console.

See also https://stackoverflow.com/a/304447/354577

Community
  • 1
  • 1
Chris
  • 93,263
  • 50
  • 204
  • 189