Find full path of the Python interpreter?

vy32 picture vy32 · Apr 7, 2010 · Viewed 249.8k times · Source

How do I find the full path of the currently running Python interpreter from within the currently executing Python script?

Answer

Imran picture Imran · Apr 7, 2010

sys.executable contains full path of the currently running Python interpreter.

import sys

print(sys.executable)

which is now documented here