Hi I have a Mac and happen to have many different flavors of Python installed everywhere.
right now when I opened up python in terminal, type in
which python
the return result is:
//anaconda/bin/python
I am wondering what should I do to change the default python to a python that I like, so next time when I do:
which python
the path should be:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Thanks!
解决方案
which command uses the directories listed in $PATH to search for the first occurrence of a command. If you want to list all instances of executables, use -a option.
which python2.7
Output:
/usr/bin/python2.7
This will display symbolic link to /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
to resolve symbolic link use
readlink $(which python2.7)
output:
../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7