Dnaiel Dnaiel - 1 year ago 122
Python Question

macOS X weird python

short Q,

In a mac OS sierra terminal,

If I do:

whereis python

Then if I do:
it opens python 2.10

but if I execute
it opens python 2.7.8.

How can I know whereis python 2.7.8 and why whereis points to a different python version than the default one?

wim wim
Answer Source

You can run python and check the sys.executable.

>>> import sys
>>> sys.executable
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download