July 23, 2013

Python/Numpy version collisions

   
Before this accident, I did not even know there were so many places relevant with a single program... I opened the pandora's box beginning with using brew doctor  which told me to move directory /usr/local/bin/ prior to /usr/bin/ so that all the homebrewed packages could be found automatically. After I did this, if I executed matplotlib, I would have this runtime error RuntimeError: module compiled against API version 8 but this version of numpy is 6 which was somewhat correct by the way. Because I used superpack installed the latest version of numpy(1.8), scipy(0.13), and matplotlib(1.4), but if I printed out the "numpy.__version__" in a script, it showed 1.6.1.

1) delete all of the outdated versions of numpy
2) make sure I explicitly add PYTHONPATH in the bash_profile.
3) I even uninstalled and reinstalled the numpy
But the problem was still there.

After an exhausted search, I found that numpy-1.6.1 in "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/" WTF! I still don't know why it search into 2.6 given there is another 2.7 in the same level of directory. Deleting both 2.6 and 2.7 directories (only delete the 2.6 could not work either...) finally solved the problem. ahooooo....

July 1, 2013

Setup emacs in Mac OS


The setup is much harder than I thought...

1) using homebrew installs the emacs and guile. Then, I also need to add path in the .bash_profile to launch the up-to-date emacs rather than the original version 22.1 shipped with the os.
export PATH=/usr/local/Cellar/emacs/24.3/bin:$PATH
2) Enable the Meta key in terminal, or similar position for iterm2.

After these two steps, the following is more straightforward.

3) I accidentally found this "emacs-starter-kit", which had 2300+ stared and really saved my day. Just follow the instruction and everything will be fine.

In current state, I feel emacs kind of like vim+tmux. Anyway, learning new knowledge is always a pleasure, especially about this kind of "legacy" stuff.


cheers,

[UPDATE: after changed the loading sequence of bash in /etc/paths/ the first step seems unnecessary... actually, that was something I should do as soon as I used homebrew to port packages. http://bit.ly/IUVl9a

Days of our lives

Daisypath Anniversary tickers