python -c "import os, sys; print(os.path.dirname(sys.executable))"
Source: https://stackoverflow.com/questions/647515/