首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装pyhdf错误: hdf.h:没有这样的文件或目录

安装pyhdf错误: hdf.h:没有这样的文件或目录
EN

Stack Overflow用户
提问于 2016-08-26 11:35:17
回答 1查看 2.6K关注 0票数 2

我想在ubuntu上安装pyhdf来读取python中的hdf4文件,我从https://sourceforge.net/projects/pysclint/files/pyhdf/pyhdf-0.8.3.tar.gz下载的,但是当我在ubuntu上运行python setup.py install时,它显示

代码语言:javascript
复制
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

如何修复它?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-08-29 15:34:38

好了,最后我回答了我自己的问题,now...For那些想要在ubuntu上安装python-hdf4的人。

首先需要安装hdf4,然后安装python-hdf4。

可以从https://www.hdfgroup.org/products/hdf4/下载Hdf4,然后使用tar xvf ...cd将文件unzip到文件和/.configure中,如果不需要fortran,则做./configure --disable-fortran,并对其进行配置,然后逐步安装makemake checkmake install,成功安装HDF4。

接下来的事情很简单,从https://pypi.python.org/pypi/python-hdf4下载python-hdf4,然后cd到文件python setup.py install,done!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39157914

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档