Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX Anaconda default python

I have anaconda distribution installed on my macbook to my local home directory /Users/simon/anaconda

When I open up iterm and type python I see the default OSX install of python. I saw this thread here and implemented the fix mentioned: Mac using default Python despite Anaconda install

My .bash_profile currently looks like this:

export PATH="$HOME/anaconda/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH"

A few strange things happen:

  1. When I type python I still see the OSX python despite having changed my .bash_profile
  2. If I source /Users/simon/.bash_profile this actually fixes the problem. Using python now brings up anaconda's python
  3. When I quit iterm or restart my computer and try to load python again, it goes back to the OSX version. .bash_profile remains unchanged.

When I try all of the above using terminal everything works fine. The issues described above appear to be specific to iterm2 and I'm not sure why

How do I get my system to use anacondas python instead of the OSX version?

like image 222
Simon Avatar asked Sep 28 '26 20:09

Simon


1 Answers

It seems that your $PATH is redefined somewhere else in your configuration. This usually doesn't cause issue if you know in which order they are loaded and keep track of what's going on.

I recommend a bit of reading to understand more the load order.

like image 116
Thomas Ayoub Avatar answered Oct 01 '26 16:10

Thomas Ayoub



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!