在 Python 内部查看 sys.executable的方法:
启动 Python 解释器后,运行:
import sys print(sys.executable)
就能看到当前 Python 可执行文件的绝对路径。