8

Matplot lib をインストールしようとしましたが、過去のエラーを取得するのにまだ苦労しています。

numpy と psipy をインストールしましたが、easy_install を使用すると次のエラーが発生します (pip にも同様のエラーがあります)。

はい、「gcc-4.2 が見つからない」問題を解決するために、Xcode にコマンド ライン ツールをインストールしました。

pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends', 'matplotlib.backends.qt4_editor',          

'matplotlib.projections', 'matplotlib.testing', 'matplotlib.testing.jpl_units',     

'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid',     

'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist', 'matplotlib.sphinxext',    

'matplotlib.tri', 'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil.zoneinfo']
warning: no files found matching 'KNOWN_BUGS'
warning: no files found matching 'INTERACTIVE'
warning: no files found matching 'MANIFEST'
warning: no files found matching '__init__.py'
warning: no files found matching 'examples/data/*'
warning: no files found matching 'lib/mpl_toolkits'
warning: no files found matching 'LICENSE*' under directory 'license'
gcc-4.2 not found, using clang instead
In file included from src/ft2font.cpp:3:
src/ft2font.h:16:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
     ^
1 error generated.
error: Setup script exited with error: command 'clang' failed with exit status 1
4

4 に答える 4

10

最近この問題も発生しましたが、pipを使用していました。自作をインストールしている場合は、次のコマンドを実行することで解決できます。

brew install freetype
brew install libpng
brew link freetype
pip install git+https://github.com/matplotlib/matplotlib.git#egg=matplotlib-dev
于 2012-10-17T22:50:22.733 に答える
0

freetype2、または少なくとも開発バージョンがありません。ft2build.hfreetype2 ヘッダー ファイルである を探しています。

freetype2をソースからインストールするか、macports、fink、homebrew などのパッケージ マネージャーだけをインストールしてみてください (パッケージ マネージャーの場合は、利用可能な場合は開発バージョンを選択してください)。

ただし、パッケージ マネージャーを使用する場合は、その方法で matplotlib をインストールすることもできます。また、freetype2 を含む OS X 用のバイナリが存在する可能性があるため、ソースからインストールするよりも簡単な場合があります。

easy_install と pip が freetype2 をインストールしない理由は、それが Python パッケージではないからです。

==訂正==

easy_install または pip が期待する場所だけでなく、freetype2 が利用可能であるべきです。私の Mac では、/usr/X11/include で ft2build.h を実行できます。したがって、インストールを機能させるには、CFLAGS変数をそのディレクトリ (およびおそらくLDFLAGS/usr/X11/lib`) に設定する必要があります。さて、easy_install と pip では、その方法が 100% わかりません。試してみてください

CFLAGS=-I/usr/X11/include LDFLAGS=-L/usr/X11/lib easy_install matplotlib

または、matplotlib ソースをダウンロードし、自分で調整setup.pyしてビルドします。

于 2012-10-16T09:00:11.717 に答える