2017-11-30 1 views
0

brew install --debug tclose/pype9/pype9과 함께 설치할 수있는 Python 응용 프로그램에 Homebrew 수식을 쓰려고합니다. 그러나 리소스에서 h5py을 (를) 설치하려고 시도 할 때 clang 오류가 발생합니다. 다음과 같이"Python.h '파일을 찾을 수 없기 때문에 사용자 정의 Hombrew 공식에 H5py를 설치하지 못합니다.

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 

을 내가 실패한 pip 줄을 실행할 때 나는 포함 경로에 있어야 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 

를 얻을 수

$ 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 

무엇이 누락 되었습니까? 편집

:

나는이었다 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으로 시작하는 줄 아래의 줄)에서 삭제되었습니다. 그러나, 나는에 추가됩니다 것을 제어하려면이 될 이유 단서 ...

+0

패키지 관리자에'python-dev'와 같은 Python 개발 파일이 설치되어 있지 않은 것 같습니다. – hpaulj

+0

@hpaulj 마지막'stat' 호출이 보여주는 것은 아닌가요? 필요한 헤더가 설치 되었습니까? – bnaecker

+0

네, Homebrew는 "패키지 관리자"이며 분명히 파이썬 헤더를 포함하고 있습니다. 이것은 clang 사용 문제 일 수도 있습니다. –

답변

0

그래서 때문에 그 소리 (https://discourse.brew.sh/t/how-do-the-custom-search-paths-get-into-clang/411)의 일부 브루 해커에이 문제가되는 것은 나온다을 가지고 clang에 대해 충분히 모른다 clang 검색 경로와 빌드 시간.

해결 방법은 :build 한정자를 Python 종속성에 추가하는 것입니다 (예 :

depends_on :python => :build 

홈 브루 포뮬러.

관련 문제