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
  • 41,580
  • 88
  • 260
  • 469

2 Answers2

5

You can do this:

>>> import sys
>>> sys.executable
C:\Python35\python.exe
Andy
  • 49,085
  • 60
  • 166
  • 233
  • 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
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257