Python の setuptools に関する質問です。Mac OS 10.8 を新規インストールし、公式の Python 2.7.3 パッケージをインストールしました。py-bcrypt
バイナリ モジュール(またはその他のバイナリ モジュール) をインストールすると、次のエラーが発生します。
bcrypt/bcrypt_python.c:17:10: fatal error: 'Python.h' file not found
#include "Python.h"
^
1 error generated.
error: Setup script exited with error: command 'clang' failed with exit status 1
実行sudo easy_install --verbose py-bcrypt
すると、CLang への次の呼び出しが表示されます。
clang -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c bcrypt/bcrypt_python.c -o build/temp.macosx-10.8-intel-2.7/bcrypt/bcrypt_python.o
...この部分を除いて問題ありません:
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
Python.h
実際には、ここの非システム ライブラリに格納されているためです。/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h
最後に要点を説明します: setuptools が使用するデフォルトのインクルード パスをどのように変更しますか?