新しいmacbookで、homebrewで色々入れていたら、以下のようなエラーが出た。
$ brew install emacs --HEAD --cocoa
==> Cloning bzr://http://bzr.savannah.gnu.org/r/emacs/trunk
bzr: ERROR: Couldn't import bzrlib and dependencies.
Please check the directory containing bzrlib is on your PYTHONPATH.
Traceback (most recent call last):
File "/usr/local/bin/bzr", line 74, in <module>
import bzrlib
ImportError: No module named bzrlib
Error: Failure while executing: /usr/local/bin/bzr checkout --lightweight http://bzr.savannah.gnu.org/r/emacs/trunk /Library/Caches/Homebrew/emacs--bzr
他の何かのパッケージでもエラーが出たような気がする。
bzrというコマンドが、Pythonのbzrlibというパッケージを参照しているけど、MacのシステムのPythonがそれをみつけられてなかった。
Homebrewが入れたbzrには、ちゃんとbzrlibがついてきてるので、シンボリックリンク張ったら直った。
$ sudo ln -s /usr/local/Cellar/bazaar/2.5.1/lib/python2.7/site-packages/bzrlib /Library/Python/2.7/site-packages/bzrlib
あるいは、pythonもHomebrewから入れるとこういう問題が起きないのかな? (未検証)
あと、以前はなぜこの問題がなかったのかもよくわからない。