sys.executable should work as specified in the Python specification.
A string giving the absolute path of the executable binary for the Python interpreter, on systems where this makes sense. If Python is unable to retrieve the real path to its executable, sys.executable will be an empty string or None.
Source: https://docs.python.org/3/library/sys.html#sys.executable (emphasis are mine)
sys.executable should be either None or an empty string or C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe (or the path of the python.exe of the currently used Python environment).
As of today, sys.executable is equals C:\Program Files\ArcGIS\Pro\bin\ArcGISPro.exe when using the ArcGIS Pro built-in Python console or the built-in Notebook feature.
ArcGISPro.exe is obviously not a Python interpreter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.