Installation issue with pip and pyhdf
snorre2 opened this issue · comments
What version of pyhdf, HDF4, and Python are you using?
pyhdf version: 0.10.2
HDF4 C library version: hdf-4.2.14
Python version: Python 2.7.16
What operating system are you using?
Linux (CentOS 7.7)
What did you do?
python -m pip install --no-build-isolation --global-option=build_ext --global-option="-L/usr/local/pkgs/szip_2.1/lib" pyhdf
cp /usr/local/pkgs-modules/Python_2.7.8/lib/python2.7/site-packages/pyhdf/_hdfext.so /usr/local/pkgs-modules/Python_2.7.8/lib/python2.7/site-packages
from pyhdf.SD import SD, SDC
What did you expect to see?
No error message, imports correctly.
What did you see instead?
Issue with finding szip library.
File "/usr/local/pkgs-modules/Python_2.7.16/lib/python2.7/site-packages/pyhdf/SD.py", line 1003, in
from . import hdfext as _C
File "/usr/local/pkgs-modules/Python_2.7.16/lib/python2.7/site-packages/pyhdf/hdfext.py", line 17, in
_hdfext = swig_import_helper()
File "/usr/local/pkgs-modules/Python_2.7.16/lib/python2.7/site-packages/pyhdf/hdfext.py", line 16, in swig_import_helper
return importlib.import_module('_hdfext')
File "/usr/local/pkgs-modules/Python_2.7.16/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
ImportError: /usr/local/pkgs-modules/Python_2.7.16/lib/python2.7/site-packages/_hdfext.so: undefined symbol: SZ_BufftoBuffDecompress
Related bugs
See this related ticket/issue: #8
I'm experiencing this exact same issue, where the "szip" library is not found.
In our case, we needed to install "pyhdf" with the --no-build-isolation
, and we also had to copy the _hdfext.so
into the site-packages
directory to fix the issue of that library not being found.
This szip library is installed in "/usr/local/pkgs/szip_2.1/lib". And copying libsz.so.2
into site-packages
did not work.
Where should this szip library go, if putting it in root /lib/ is not possible (we are using GNU modules)?
See
man 8 ldconfig
. My guess is either ldconfig cache is out of date or you don't have /usr/local/lib in /etc/ld.so.conf
My pip issue is at: pypa/pip#8060