When I am running a script get the path of Python kernel (not mater if it is Python, IPython, or IPython Notebook with non-standard kernel, where I can switch between Py2 and Py3).
When writting (in IPython)
import sys
sys.argv
I get the path to IPython: ['/usr/local/bin/ipython']
.
Is it possible to get the path to Python as well?
I need it so to match versions of Python from IPython (Notebook) to Spark worker (PYSPARK_PYTHON
).