fhs / pyhdf

Python wrapper around the NCSA HDF version 4 library

Home Page:https://pypi.org/project/pyhdf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

problems with pip install

jslavin opened this issue · comments

Hi,

I just tried to install python-hdf4 via pip and it failed. I'm using pip in the anaconda distribution. The problem seems to be with compiling hdfext_wrap.c:

pyhdf/hdfext_wrap.c:3543:17: error: hdf.h: No such file or directory
pyhdf/hdfext_wrap.c:3544:19: error: mfhdf.h: No such file or directory
pyhdf/hdfext_wrap.c: In function ‘_HEprint’:
pyhdf/hdfext_wrap.c:3674: warning: implicit declaration of function ‘HEprint’
pyhdf/hdfext_wrap.c:3678:57: error: hdfi.h: No such file or directory
In file included from /export/slavin/python/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804,

...(etc.)

so certain header files are missing, which leads to a bunch of 'undeclared' errors (I think), and finally:

error: Command "gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/export/slavin/python/anaconda/lib/python2.7/site-packages/numpy/core/include -I/export/slavin/python/anaconda/include/python2.7 -c pyhdf/hdfext_wrap.c -o build/temp.linux-x86_64-2.7/pyhdf/hdfext_wrap.o -DNOSZIP" failed with exit status 1

Any suggestions?

Regards,
Jon Slavin

You need to have the hdf4 C library installed in your system. See the installation instructions: http://fhs.github.io/python-hdf4/install.html

I do have it installed. I needed to have the environment variables INCLUDE_DIRS and LIBRARY_DIRS set. I did that and everything installed correctly. I did that yesterday and should have updated my post.

I get this error message:

pyhdf/hdfext_wrap.c:3681:10: fatal error: 'hdf.h' file not found