2017-11-30 16 views
0

開発中のPythonアプリケーションのHomebrew式をbrew install --debug tclose/pype9/pype9でインストールしようとしています。しかし、リソースからh5pyをインストールしようとすると、clangエラーが発生します。"Python.h 'ファイルが見つからないため、H5pyのカスタムHombrew式内でpipを使用してインストールできません。

次のようにHombrewのエラーメッセージは次のとおりです。

==> /usr/local/Cellar/pype9/0.2/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/pype9--h5py-20171130-7088-edeq3s/h5py-2.7.1 
Last 15 lines from /Users/tclose/Library/Logs/Homebrew/pype9/07.pip: 
    Removing source in /private/tmp/pip-yn6C6Y-build 
Command "/usr/local/Cellar/pype9/0.2/libexec/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-yn6C6Y-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qY4COY-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/Cellar/pype9/0.2/libexec/bin/../include/site/python2.7/h5py" failed with error code 1 in /private/tmp/pip-yn6C6Y-build/ 
Exception information: 
Traceback (most recent call last): 
    File "/usr/local/Cellar/pype9/0.2/libexec/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main 
    status = self.run(options, args) 
    File "/usr/local/Cellar/pype9/0.2/libexec/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run 
    prefix=options.prefix_path, 
    File "/usr/local/Cellar/pype9/0.2/libexec/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install 
    **kwargs 
    File "/usr/local/Cellar/pype9/0.2/libexec/lib/python2.7/site-packages/pip/req/req_install.py", line 878, in install 
    spinner=spinner, 
    File "/usr/local/Cellar/pype9/0.2/libexec/lib/python2.7/site-packages/pip/utils/__init__.py", line 707, in call_subprocess 
    % (command_desc, proc.returncode, cwd)) 
InstallationError: Command "/usr/local/Cellar/pype9/0.2/libexec/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-yn6C6Y-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qY4COY-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/Cellar/pype9/0.2/libexec/bin/../include/site/python2.7/h5py" failed with error code 1 in /private/tmp/pip-yn6C6Y-build/ 
/usr/local/Homebrew/Library/Homebrew/debrew.rb:11:in `raise' 
BuildError: Failed executing: /usr/local/Cellar/pype9/0.2/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/pype9--h5py-20171130-7088-edeq3s/h5py-2.7.1 

と私はPython.hがインクルードパス

にする必要がありますように非常に奇妙なようだ私は

clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DH5_USE_16_API -I./h5py -I/private/tmp/pip-H460U_-build/lzf -I/opt/local/include -I/usr/local/include -I/private/tmp/pip-H460U_-build/.eggs/numpy-1.13.3-py2.7-macosx-10.12-x86_64.egg/numpy/core/include -I/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/tmp/pip-H460U_-build/h5py/defs.c -o build/temp.macosx-10.12-x86_64-2.7/private/tmp/pip-H460U_-build/h5py/defs.o 
    /private/tmp/pip-H460U_-build/h5py/defs.c:48:10: fatal error: 'Python.h' file not found 
    #include "Python.h" 
      ^~~~~~~~~~ 
    1 error generated. 
    error: command 'clang' failed with exit status 1 

を取得できなかったpipラインを実行します。

$ stat /usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h 
16777220 46773239 -rw-r--r-- 1 tclose staff 0 4329 "Nov 28 13:43:30 2017" "Sep 17 03:49:51 2017" "Oct 1 19:18:02 2017" "Sep 17 03:49:51 2017" 4096 16 0 /usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h 

私は何が欠けていますか? EDIT

は私がされていPython.h

-I/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/include/python2.7 

として、それは見つけることができない理由を説明している以下の

bash-3.2$ clang -v -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DH5_USE_16_API -I./h5py -I/private/tmp/pip-hKPCxh-build/lzf -I/opt/local/include -I/usr/local/include -I/private/tmp/pip-hKPCxh-build/.eggs/numpy-1.13.3-py2.7-macosx-10.12-x86_64.egg/numpy/core/include -I/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/tmp/pip-hKPCxh-build/h5py/defs.c -o defs.o 
Apple LLVM version 9.0.0 (clang-900.0.38) 
Target: x86_64-apple-darwin16.7.0 
Thread model: posix 
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin 
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.12.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name defs.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -fno-strict-return -masm-verbose -munwind-tables -target-cpu haswell -target-feature +sse2 -target-feature +cx16 -target-feature -tbm -target-feature -avx512ifma -target-feature -avx512dq -target-feature -fma4 -target-feature -prfchw -target-feature +bmi2 -target-feature -xsavec -target-feature +fsgsbase -target-feature +popcnt -target-feature +aes -target-feature -pcommit -target-feature -xsaves -target-feature -avx512er -target-feature -clwb -target-feature -avx512f -target-feature -pku -target-feature -smap -target-feature +mmx -target-feature -xop -target-feature -rdseed -target-feature -hle -target-feature -sse4a -target-feature -avx512bw -target-feature -clflushopt -target-feature +xsave -target-feature -avx512vl -target-feature +invpcid -target-feature -avx512cd -target-feature +avx -target-feature -rtm -target-feature +fma -target-feature +bmi -target-feature -mwaitx -target-feature +rdrnd -target-feature +sse4.1 -target-feature +sse4.2 -target-feature +avx2 -target-feature +sse -target-feature +lzcnt -target-feature +pclmul -target-feature -prefetchwt1 -target-feature +f16c -target-feature +ssse3 -target-feature -sgx -target-feature +cmov -target-feature -avx512vbmi -target-feature +movbe -target-feature +xsaveopt -target-feature -sha -target-feature -adx -target-feature -avx512pf -target-feature +sse3 -target-linker-version 302.3.1 -v -dwarf-column-info -debugger-tuning=lldb -coverage-notes-file /private/tmp/pype9--h5py-20171130-16848-1wufcte/h5py-2.7.1/defs.gcno -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0 -isystem /usr/local/include -isystem /usr/include/libxml2 -isystem /opt/X11/include -isystem /opt/X11/include/freetype2 -isystem /System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers -D NDEBUG -D H5_USE_16_API -I ./h5py -I /private/tmp/pip-hKPCxh-build/lzf -I /private/tmp/pip-hKPCxh-build/.eggs/numpy-1.13.3-py2.7-macosx-10.12-x86_64.egg/numpy/core/include -I /usr/local/opt/readline/include -Os -w -fdebug-compilation-dir /private/tmp/pype9--h5py-20171130-16848-1wufcte/h5py-2.7.1 -ferror-limit 19 -fmessage-length 362 -fwrapv -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.12.0 -fencode-extended-block-signature -fmax-type-align=16 -fno-common -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o defs.o -x c /private/tmp/pip-hKPCxh-build/h5py/defs.c 
clang -cc1 version 9.0.0 (clang-900.0.38) default target x86_64-apple-darwin16.7.0 
ignoring duplicate directory "/usr/local/include" 
#include "..." search starts here: 
#include <...> search starts here: 
./h5py 
/private/tmp/pip-hKPCxh-build/lzf 
/private/tmp/pip-hKPCxh-build/.eggs/numpy-1.13.3-py2.7-macosx-10.12-x86_64.egg/numpy/core/include 
/usr/local/opt/readline/include 
/usr/local/include 
/usr/include/libxml2 
/opt/X11/include 
/opt/X11/include/freetype2 
/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include 
/usr/include 
/System/Library/Frameworks (framework directory) 
/Library/Frameworks (framework directory) 
End of search list. 
/private/tmp/pip-hKPCxh-build/h5py/defs.c:48:10: fatal error: 'Python.h' file not found 
#include "Python.h" 
     ^~~~~~~~~~ 
1 error generated. 

を得た冗長フラグをオンにした上clangのコマンドを実行しました拡張された呼び出しであるclang(InstalledDirで始まる行の下の行)から削除されました。しかし、私はclangについて何か手がかりを知りません...

+0

パッケージマネージャに 'python-dev'のようなPython開発ファイルがインストールされていないようですね。 – hpaulj

+0

@hpaulj最後の 'stat'呼び出しが示していることではありませんか?必要なヘッダーがインストールされていることを確認しますか? – bnaecker

+0

ええ、Homebrewは "パッケージマネージャ"であり、Pythonヘッダーを含んでいますが、これはclangの使用上の問題かもしれません。 –

答えて

関連する問題