2

pyhdfubuntu の python で hdf4 ファイルを読み取るためにインストールしたいのですが、https://sourceforge.net/projects/pysclint/files/pyhdf/からダウンロードしましたが、ubuntu でpyhdf-0.8.3.tar.gz実行すると表示されます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

修正方法は?

4

1 に答える 1

1

最後に、私は今、自分の質問に答えています... python-hdf4 を ubuntu にインストールしたい人のために。

最初に hdf4 をインストールし、次に python-hdf4 をインストールする必要があります。

Hdf4 はhttps://www.hdfgroup.org/products/hdf4/からダウンロードできます。次に、unzipを使用tar xvf ...cdてファイルをファイルに変換し、 /.configurefortran が必要ない場合は を実行し./configure --disable-fortran、構成する必要があります。ステップバイステップで、HDF4 が正常にインストールされるはずです。makemake checkmake install

次は簡単です。https: //pypi.python.org/pypi/python-hdf4 から python-hdf4 をダウンロードし、cd でファイルに移動しますpython setup.py install

于 2016-08-29T07:34:38.040 に答える