2011-12-02 27 views
35

pip install matplotlibgit cloneを入力してからpython setup.py installを試しましたが、これはMac OS 10.7のthe installation faqです。しかし、私は同じエラーが発生します:matplotlibのインストール中にエラーが発生しました

[...] 
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I. -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/freetype2 -I./freetype2 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/ft2font.cpp -o build/temp.macosx-10.7-intel-2.7/src/ft2font.o 
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ 
In file included from src/ft2font.cpp:3: 
src/ft2font.h:16:22: error: ft2build.h: No such file or directory 
src/ft2font.h:17:10: error: #include expects "FILENAME" or <FILENAME> 
src/ft2font.h:18:10: error: #include expects "FILENAME" or <FILENAME> 
src/ft2font.h:19:10: error: #include expects "FILENAME" or <FILENAME> 
src/ft2font.h:20:10: error: #include expects "FILENAME" or <FILENAME> 
src/ft2font.h:21:10: error: #include expects "FILENAME" or <FILENAME> 
In file included from src/ft2font.cpp:3: 
src/ft2font.h:34: error: ‘FT_Bitmap’ has not been declared 
src/ft2font.h:34: error: ‘FT_Int’ has not been declared 
src/ft2font.h:34: error: ‘FT_Int’ has not been declared 
src/ft2font.h:86: error: expected ‘,’ or ‘...’ before ‘&’ token 
[...] 

私のシステムにいくつかのパッケージがインストールされていないようですね?またはmatplotlibをインストールするための他の良い方法はありますか?

ありがとうございます!

UPDATE:グーグルとSO私は私が警告メッセージを取得自作してインストールしようとする場合、私は、しかし、パッケージfreetype2のに欠けている可能性があることを発見した上で検索:

[me @ my mac]$ brew search freetype 
Apple distributes freetype with OS X, you can find it in /usr/X11/lib. 
However not all build scripts look here, so you may need to call ENV.x11 
in your formula's install function. 
+0

私のエラーメッセージは違っていましたが、 'brew install freetype'と' pip install matplotlib'はOSX 10.8で私のトリックでした。2 – hobs

+1

@hobs: 'pip install matplotlib'を成功させるには' brew install libpng'も使用しなければなりませんでした。これらのパッケージをリストアップしてくれたJavierに感謝します。 –

答えて

80

この問題は、Ubuntuサーバー12.04で発生しました。

私はlibfreetype6-devlibpng-devをリポジトリからインストールしなければなりませんでした。私はvirtualenvを使い、この問題に遭遇したときにpipを使ってmatplotlibをインストールしていました。

私がこれを行う必要があるというヒントは、matplotlibのインストールの初期段階でポップアップする警告メッセージに由来しているので、依存関係が見つかったがヘッダーは見つからないというメッセージを見守ってください。

+1

絶対に正しい。 (Ubuntu 12.04) –

+0

ここに素晴らしいポインタ。 pkgsを登録していただきありがとうございます。バットからすぐに問題を修正しました。 – bitcycle

+1

ありがとう、それは完全に働いた(Ubuntu 12.04、python 2.7.3、virtualenv) –

13

同じエラーを、インストールは私のLionマシンの1台で動作しましたが、もう1台は動作しませんでした。行方不明のpkg-config設定

$ brew install pkg-config 
$ pip install -U 'http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/matplotlib-1.1.0.tar.gz/download' 

にそれを突き止め上記のリンクのため

+0

リンクが削除されたようです。ところで、OS X 10.8 Mountain Lionにpkg-configをインストールするのに違いはありますか? brewのインストール中にエラーが発生しましたpkg-config – clwen

+1

update:X11がインストールされた後、pkg-configをインストールできます。その後、githubからmatplotlibのソースをダウンロードし、ソースからビルドすることができます。 – clwen

2

感謝を(もhttps://jholewinski.org/blog/installing-matplotlib-on-os-x-10-7-with-homebrew/参照)。私はmatplotlibに若干の変更を加えることができました。私は将来の参照のために、私が遭遇した特定のエラーメッセージを文書化しています。

ENV: のMac OS X 10.7.4(ライオン)

が、私は、デフォルトのインストールに不利に働いmatplotlibの取得しようとして始めたディレクトリ(/ usr/binにあります)の株式のpython 2.7.1を実行しています。

/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/__multiarray_api.h:1187: warning: ‘int _import_array()’ defined but not used 
lipo: can't open input file: /var/tmp//ccG28dDI.out (No such file or directory) 

を支援しませんでしたこのファイルをグーグル:次のエラーメッセージで失敗する

freetype2: found, but unknown version (no pkg-config) 
         * WARNING: Could not find 'freetype2' headers in any 
         * of '.', './freetype2'. 

OPTIONAL BACKEND DEPENDENCIES 
       libpng: found, but unknown version (no pkg-config) 
         * Could not find 'libpng' headers in any of '.' 

セットアップ手順を:setup.pyを具体的にいくつかの問題を示唆しました何でも私は少し掘って、それが私の時間virtualenvルートを下る価値がないと決めた。

私は上記のjholewinskiリンクに記載されている手順に従いました。/usr/local /に新しいPython 2.7.4をインストールし、そこにある指示に従ってください。 (私はpkg-configを再インストールしました)。 gitからmatplotlibの最新バージョンを取得できました。うまくいきました。

今回は、libpng(1.5.4)とfreetype2(13.2.7)の両方のライブラリが存在していました。

関連する問題