Python 安装pyhdf错误:hdf.h:没有这样的文件或目录
我想在ubuntu上安装Python 安装pyhdf错误:hdf.h:没有这样的文件或目录,python,pyhdf,Python,Pyhdf,我想在ubuntu上安装pyhdf来读取python中的hdf4文件,我从pyhdf-0.8.3.tar.gz下载,但在ubuntu上运行python setup.py install时,它会显示 running install running bdist_egg running egg_info running build_src build_src building extension "pyhdf._hdfext" sources build_src: building npy-pkg c
pyhdf
来读取python中的hdf4文件,我从pyhdf-0.8.3.tar.gz
下载,但在ubuntu上运行python setup.py install
时,它会显示
running install
running bdist_egg
running egg_info
running build_src
build_src
building extension "pyhdf._hdfext" sources
build_src: building npy-pkg config files
writing pyhdf.egg-info/PKG-INFO
writing top-level names to pyhdf.egg-info/top_level.txt
writing dependency_links to pyhdf.egg-info/dependency_links.txt
reading manifest file 'pyhdf.egg-info/SOURCES.txt'
writing manifest file 'pyhdf.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'pyhdf._hdfext' extension
compiling C sources
C compiler: x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC
compile options: '-I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c'
x86_64-linux-gnu-gcc: pyhdf/hdfext_wrap.c
pyhdf/hdfext_wrap.c: In function ‘SWIG_Python_AddErrorMsg’:
pyhdf/hdfext_wrap.c:859:5: error: format not a string literal and no format arguments [-Werror=format-security]
PyErr_Format(PyExc_RuntimeError, mesg);
^
pyhdf/hdfext_wrap.c: At top level:
pyhdf/hdfext_wrap.c:3048:17: fatal error: hdf.h: No such file or directory
cc1: some warnings being treated as errors
compilation terminated.
pyhdf/hdfext_wrap.c: In function ‘SWIG_Python_AddErrorMsg’:
pyhdf/hdfext_wrap.c:859:5: error: format not a string literal and no format arguments [-Werror=format-security]
PyErr_Format(PyExc_RuntimeError, mesg);
^
pyhdf/hdfext_wrap.c: At top level:
pyhdf/hdfext_wrap.c:3048:17: fatal error: hdf.h: No such file or directory
cc1: some warnings being treated as errors
compilation terminated.
error: Command "x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c pyhdf/hdfext_wrap.c -o build/temp.linux-x86_64-2.7/pyhdf/hdfext_wrap.o" failed with exit status 1
如何修复它?最后,我要回答我自己的问题了……对于那些想在ubuntu上安装python-hdf4的人来说 首先需要安装hdf4,然后安装python-hdf4 Hdf4可以从下载,然后使用
tar xvf…
,cd
将文件解压缩到文件和/。配置
,如果您不需要fortran,则执行/configure--禁用fortran
,并且应该对其进行配置,然后执行make
,make check
,make install
逐步安装,HDF4应该安装成功
接下来的事情很简单,从下载python-hdf4,然后将cd下载到文件python setup.py install
,完成