short Q,
In a mac OS sierra terminal,
If I do:
whereis python
/usr/bin/python
Then if I do:
/usr/bin/python it opens python 2.10
but if I execute
python 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?
whereis only looks in a few standard places. Use which -a python to get a list of directories in your PATH variable that contain python. For instance, on my machine
$ whereis bash
/bin/bash
$ which -a bash
/usr/local/bin/bash
/bin/bash
$ echo "$PATH"
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
As to why whereis does not report the python that actually runs, note in my example that whereis only reports /bin/bash. However, /usr/local/bin appears earlier in my PATH than /bin, so typing bash alone at a prompt runs the first one found while scanning PATH. In your case, you likely also have Python 2.7.8 in a directory that appears earlier in your path than /usr/bin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With