Nono.MA

Get Python binary executable location in Python

JUNE 3, 2022

Here's how to determine the location of the active Python binary.

import sys

# Get Python binary's location.
print(sys.executable)
# /Users/nono/miniforge3/bin/python

See how to get Python's version information.

BlogCodePython