Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac Default Python Path Change

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!

like image 586
B.Mr.W. Avatar asked Sep 11 '26 19:09

B.Mr.W.


1 Answers

When you installed Anaconda it should have added a new item to your PATH variable, right at the front. You should see something like this in your *~/.bash_profile* file:

# added by Anaconda 1.8.0 installer
export PATH="//anaconda/bin:$PATH"

You can remove these lines, reopen any terminal window you have and your default Python should have been restored.

like image 71
sergiopereira Avatar answered Sep 13 '26 09:09

sergiopereira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!