matplotlibをインストールしようと思うと、結構事前に必要なものが多く、それはREADMEなりをご参照ください。numpy,libpng,zlib,freetypeなどが必要です。
必要なものをそろえて、buildしようとするも、なぜかエラーが出てしまいます。 ld: in /opt/local/lib/libJPEG.dylib, file is not of required architecture for architecture ppc collect2: ld returned 1 exit status ld: warning, duplicate dylib /opt/local/lib/libz.1.dylib lipo: can't open input file: /var/folders/tu/tu2X2sjGHXeuVHVC+zSba++++TI/-Tmp-//cc68rYIJ.out (No such file or directory) error: command 'g++' failed with exit status 1 なに言ってるんだと思いつつも、どうやら、ライブラリがuniversal binaryでないことが原因の模様。いろいろ調べるとよい情報があって、 http://ipython.scipy.org/moin/MatplotlibOSXBuildNotes このページで、libpngとfreetypeのユニバーサルバイナリを作ってmatplotlibをインストールしています。 ただ、なぜか私の環境ではうまくいかず、頭にきたので結局、一時的に/optをリネームするという強硬手段に出ました。なんか、かっこ悪いですが。。。 sudo mv opt opt_bak これで、opt以下のライブラリが読めなくなり、あっさりうまくいきました。 ちなみに、ユニバーサルなバイナリかどうかは、fileというコマンドでわかります。 /$ file /usr/local/lib/libpng.a /usr/local/lib/libpng.a: Mach-O universal binary with 4 architectures /usr/local/lib/libpng.a (for architecture i386): current ar archive random library /usr/local/lib/libpng.a (for architecture ppc): current ar archive random library /usr/local/lib/libpng.a (for architecture ppc64): current ar archive random library /usr/local/lib/libpng.a (for architecture x86_64): current ar archive random library /$ file /opt/local/lib/libpng.a /opt/local/lib/libpng.a: current ar archive random library いろいろもがいていると、いいものも見つかるときもありまして、libpngとlibjpegをぼけぼけしながらインストールできる、 http://ethan.tira-thompson.com/Mac%20OS%20X%20Ports.html こんなものがありました。 Mac相変わらず、内部的にすこし複雑ですよねー。 スポンサーサイト
|
|
| ホーム |
|