我一直在尝试安装 pyhdf,但是收到此错误消息,我似乎无法找到解决方案。
ERROR: Command errored out with exit status 1:
command: /project/InSAR/user1/venv/test/bin/python /project/InSAR/user1/venv/test/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpwm9u6ko8
cwd: /tmp/pip-install-s90teiwu/pyhdf_0b2593bd32224d91a63b3304860de144
Complete output (40 lines):
running bdist_wheel
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "pyhdf._hdfext" sources
build_src: building npy-pkg config files
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/pyhdf
copying pyhdf/__init__.py -> build/lib.linux-x86_64-3.7/pyhdf
copying pyhdf/six.py -> build/lib.linux-x86_64-3.7/pyhdf
copying pyhdf/V.py -> build/lib.linux-x86_64-3.7/pyhdf
copying pyhdf/VS.py -> build/lib.linux-x86_64-3.7/pyhdf
copying pyhdf/test_SD.py -> build/lib.linux-x86_64-3.7/pyhdf
copying pyhdf/error.py -> build/lib.linux-x86_64-3.7/pyhdf
copying pyhdf/HDF.py -> build/lib.linux-x86_64-3.7/pyhdf
copying pyhdf/SD.py -> build/lib.linux-x86_64-3.7/pyhdf
copying pyhdf/HC.py -> build/lib.linux-x86_64-3.7/pyhdf
copying pyhdf/hdfext.py -> build/lib.linux-x86_64-3.7/pyhdf
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'pyhdf._hdfext' extension
compiling C sources
C compiler: gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/hdf5/1.8.14/include -I/usr/local/gcc/4.9.3/include -I/usr/local/mpfr/3.1.4/include -I/usr/local/gmp/5.1.3/include -I/usr/local/proj/4.9.1/include -I/usr/local/geos/3.5.0/include -I/usr/local/python/3.7.2/include -I/usr/local/sqlite/3080802/include -I/usr/local/python/2.7.9/include -I/usr/local/zlib/1.2.8/include -I/usr/local/hdf5/1.8.14/include -I/usr/local/gcc/4.9.3/include -I/usr/local/mpc/1.0.3/include -I/usr/local/mpfr/3.1.4/include -I/usr/local/gmp/5.1.3/include -I/usr/local/proj/4.9.1/include -I/usr/local/geos/3.5.0/include -I/usr/local/python/3.7.2/include -I/usr/local/sqlite/3080802/include -I/usr/local/python/2.7.9/include -I/usr/local/zlib/1.2.8/include -fPIC
creating build/temp.linux-x86_64-3.7/pyhdf
compile options: '-I/usr/local/python/3.7.2/lib/python3.7/site-packages/numpy/core/include -I/project/InSAR/user1/venv/test/include -I/usr/local/python/3.7.2/include/python3.7m -c'
extra options: '-DNOSZIP'
gcc: pyhdf/hdfext_wrap.c
pyhdf/hdfext_wrap.c:3681:17: fatal error: hdf.h: No such file or directory
#include "hdf.h"
^
compilation terminated.
error: Command "gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -
I/usr/local/hdf5/1.8.14/include -I/usr/local/gcc/4.9.3/include -
I/usr/local/mpfr/3.1.4/include -I/usr/local/gmp/5.1.3/include -
I/usr/local/proj/4.9.1/include -I/usr/local/geos/3.5.0/include -
I/usr/local/python/3.7.2/include -I/usr/local/sqlite/3080802/include -
I/usr/local/python/2.7.9/include -I/usr/local/zlib/1.2.8/include -
I/usr/local/hdf5/1.8.14/include -I/usr/local/gcc/4.9.3/include -
I/usr/local/mpc/1.0.3/include -I/usr/local/mpfr/3.1.4/include -
I/usr/local/gmp/5.1.3/include -I/usr/local/proj/4.9.1/include -
I/usr/local/geos/3.5.0/include -I/usr/local/python/3.7.2/include -
I/usr/local/sqlite/3080802/include -I/usr/local/python/2.7.9/include -
I/usr/local/zlib/1.2.8/include -fPIC -
I/usr/local/python/3.7.2/lib/python3.7/site-packages/numpy/core/include -
I/project/InSAR/user1/venv/test/include -
I/usr/local/python/3.7.2/include/python3.7m -c pyhdf/hdfext_wrap.c -o
build/temp.linux-x86_64-3.7/pyhdf/hdfext_wrap.o -MMD -MF build/temp.linux-
x86_64-3.7/pyhdf/hdfext_wrap.o.d -DNOSZIP" failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pyhdf
Failed to build pyhdf
ERROR: Could not build wheels for pyhdf which use PEP 517 and cannot be installed directly
我无法解释虚线之前的段落是什么意思。我尝试过的方法包括升级pip、升级pip setuptools wheel、安装PEP517、安装gcc。任何帮助将不胜感激!
编辑:使用的命令是 pip install pyhdf
谢谢!