question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compile error when missing libhdf5.so not clear

See original GitHub issue

Hi,

The hardware I am using is ODROID C2, which has an ARM based processor. Trying to install h5py as it is a dependency of one the packages I need to use. I first ran sudo apt-get install python3-h5py and then in the virtualenv I ran pip install h5py. pip is using h5py-2.10.0.tar.gz to build the wheel.

But running into the following error -

    Loading library to get version: libhdf5.so
    error: libhdf5.so: cannot open shared object file: No such file or directory

Let me know if you have any clue how to successfully have the pip package installed.

To assist reproducing bugs, please include the following:

  • Operating System (e.g. Windows 10, MacOS 10.11, Ubuntu 16.04.2 LTS, CentOS 7) From /etc/os-release : Ubuntu 18.04.3 LTS From uname : Linux odroid 3.16.72-46 #1 SMP PREEMPT Tue Aug 13 18:09:58 -03 2019 aarch64 aarch64 aarch64 GNU/Linux

  • Python version (e.g. 2.7, 3.5) 3.7.5

  • Where Python was acquired (e.g. system Python on MacOS or Linux, Anaconda on Windows) Installed to system using sudo apt-get install python3.7 and then using it in virtualenv

  • h5py version (e.g. 2.6) python3-h5py version 2.7.1-2

  • HDF5 version (e.g. 1.8.17) Not sure, how do I check ?

  • The full traceback/stack trace shown (if it appears)

(venv) rmc@odroid:~/tf-arm$ pip install h5py
Collecting h5py
  Using cached https://files.pythonhosted.org/packages/5f/97/a58afbcf40e8abecededd9512978b4e4915374e5b80049af082f49cebe9a/h5py-2.10.0.tar.gz
Requirement already satisfied: numpy>=1.7 in ./venv/lib/python3.7/site-packages (from h5py) (1.17.4)
Requirement already satisfied: six in ./venv/lib/python3.7/site-packages (from h5py) (1.13.0)
Building wheels for collected packages: h5py
  Building wheel for h5py (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/rmc/tf-arm/venv/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2n_pntd7/h5py/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2n_pntd7/h5py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-z5x7lfhv --python-tag cp37
       cwd: /tmp/pip-install-2n_pntd7/h5py/
  Complete output (64 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-3.7
  creating build/lib.linux-aarch64-3.7/h5py
  copying h5py/ipy_completer.py -> build/lib.linux-aarch64-3.7/h5py
  copying h5py/version.py -> build/lib.linux-aarch64-3.7/h5py
  copying h5py/h5py_warnings.py -> build/lib.linux-aarch64-3.7/h5py
  copying h5py/__init__.py -> build/lib.linux-aarch64-3.7/h5py
  copying h5py/highlevel.py -> build/lib.linux-aarch64-3.7/h5py
  creating build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/attrs.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/vds.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/files.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/base.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/selections2.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/group.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/compat.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/filters.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/__init__.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/datatype.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/dims.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/dataset.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  copying h5py/_hl/selections.py -> build/lib.linux-aarch64-3.7/h5py/_hl
  creating build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_file.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5pl.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dtype.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_objects.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_deprecation.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dataset.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_attribute_create.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_base.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5d_direct_chunk.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_slicing.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dataset_swmr.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dims_dimensionproxy.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/common.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_group.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5f.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dimension_scales.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_file2.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_attrs.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_datatype.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_dataset_getitem.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_filters.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_file_image.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_completions.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_selections.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/__init__.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_threads.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5p.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_attrs_data.py -> build/lib.linux-aarch64-3.7/h5py/tests
  copying h5py/tests/test_h5t.py -> build/lib.linux-aarch64-3.7/h5py/tests
  creating build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/test_vds/test_highlevel_vds.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/test_vds/__init__.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/test_vds/test_virtual_source.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  copying h5py/tests/test_vds/test_lowlevel_vds.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
  running build_ext
  Loading library to get version: libhdf5.so
  error: libhdf5.so: cannot open shared object file: No such file or directory
  ----------------------------------------
  ERROR: Failed building wheel for h5py
  Running setup.py clean for h5py
Failed to build h5py
Installing collected packages: h5py
    Running setup.py install for h5py ... error
    ERROR: Command errored out with exit status 1:
     command: /home/rmc/tf-arm/venv/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2n_pntd7/h5py/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2n_pntd7/h5py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-405hfpno/install-record.txt --single-version-externally-managed --compile --install-headers /home/rmc/tf-arm/venv/include/site/python3.7/h5py
         cwd: /tmp/pip-install-2n_pntd7/h5py/
    Complete output (64 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-aarch64-3.7
    creating build/lib.linux-aarch64-3.7/h5py
    copying h5py/ipy_completer.py -> build/lib.linux-aarch64-3.7/h5py
    copying h5py/version.py -> build/lib.linux-aarch64-3.7/h5py
    copying h5py/h5py_warnings.py -> build/lib.linux-aarch64-3.7/h5py
    copying h5py/__init__.py -> build/lib.linux-aarch64-3.7/h5py
    copying h5py/highlevel.py -> build/lib.linux-aarch64-3.7/h5py
    creating build/lib.linux-aarch64-3.7/h5py/_hl
    copying h5py/_hl/attrs.py -> build/lib.linux-aarch64-3.7/h5py/_hl
    copying h5py/_hl/vds.py -> build/lib.linux-aarch64-3.7/h5py/_hl
    copying h5py/_hl/files.py -> build/lib.linux-aarch64-3.7/h5py/_hl
    copying h5py/_hl/base.py -> build/lib.linux-aarch64-3.7/h5py/_hl
    copying h5py/_hl/selections2.py -> build/lib.linux-aarch64-3.7/h5py/_hl
    copying h5py/_hl/group.py -> build/lib.linux-aarch64-3.7/h5py/_hl
    copying h5py/_hl/compat.py -> build/lib.linux-aarch64-3.7/h5py/_hl
    copying h5py/_hl/filters.py -> build/lib.linux-aarch64-3.7/h5py/_hl
    copying h5py/_hl/__init__.py -> build/lib.linux-aarch64-3.7/h5py/_hl
    copying h5py/_hl/datatype.py -> build/lib.linux-aarch64-3.7/h5py/_hl
    copying h5py/_hl/dims.py -> build/lib.linux-aarch64-3.7/h5py/_hl
    copying h5py/_hl/dataset.py -> build/lib.linux-aarch64-3.7/h5py/_hl
    copying h5py/_hl/selections.py -> build/lib.linux-aarch64-3.7/h5py/_hl
    creating build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_file.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_h5pl.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_dtype.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_objects.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_h5.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_deprecation.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_dataset.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_attribute_create.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_base.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_h5d_direct_chunk.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_slicing.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_dataset_swmr.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_dims_dimensionproxy.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/common.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_group.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_h5f.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_dimension_scales.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_file2.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_attrs.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_datatype.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_dataset_getitem.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_filters.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_file_image.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_completions.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_selections.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/__init__.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_threads.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_h5p.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_attrs_data.py -> build/lib.linux-aarch64-3.7/h5py/tests
    copying h5py/tests/test_h5t.py -> build/lib.linux-aarch64-3.7/h5py/tests
    creating build/lib.linux-aarch64-3.7/h5py/tests/test_vds
    copying h5py/tests/test_vds/test_highlevel_vds.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
    copying h5py/tests/test_vds/__init__.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
    copying h5py/tests/test_vds/test_virtual_source.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
    copying h5py/tests/test_vds/test_lowlevel_vds.py -> build/lib.linux-aarch64-3.7/h5py/tests/test_vds
    running build_ext
    Loading library to get version: libhdf5.so
    error: libhdf5.so: cannot open shared object file: No such file or directory
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/rmc/tf-arm/venv/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2n_pntd7/h5py/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2n_pntd7/h5py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-405hfpno/install-record.txt --single-version-externally-managed --compile --install-headers /home/rmc/tf-arm/venv/include/site/python3.7/h5py Check the logs for full command output.

h5py.version.info contains the needed versions, which can be displayed by

python -c 'import h5py; print(h5py.version.info)'

where python should be substituted for the path to python used to install h5py with.

hmm… could not install h5py so can’t provide this info.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

17reactions
gswebspacecommented, Dec 9, 2019

Thanks ! Seems like that was the issue. It could have been much better if pip was able to point out the missing dependency.

pip is installing from source but hdf5 was not installed.

Installed required packages using sudo apt-get install pkg-config libhdf5-100 libhdf5-dev and now pip was able to build the .whl file.

3reactions
rachmadaniHaryonocommented, Jan 4, 2022

i’m on ubuntu 21.10 and there is no libhdf5-100. but libhdf5-dev is already enough

> agi libhdf5-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  hdf5-helpers libaec-dev libaec0 libhdf5-103-1 libhdf5-cpp-103-1 libhdf5-fortran-102 libhdf5-hl-100 libhdf5-hl-cpp-100 libhdf5-hl-fortran-100 libsz2
Suggested packages:
  libhdf5-doc
The following NEW packages will be installed:
  hdf5-helpers libaec-dev libaec0 libhdf5-103-1 libhdf5-cpp-103-1 libhdf5-dev libhdf5-fortran-102 libhdf5-hl-100 libhdf5-hl-cpp-100 libhdf5-hl-fortran-100 libsz2
Read more comments on GitHub >

github_iconTop Results From Across the Web

libhdf5.so.101: cannot open shared object file - Stack Overflow
Try sudo apt install python3-h5py after reinstalling. Solved the error for me in linux-aarch64.
Read more >
Ubuntu20.04 libhdf5.so.8 and libH5Part.so.0 not found
I compiled hdf5 and h5part in ubuntu 20.04, linked them inside makefile and \etc\profile . But when I run mpirun -np 4 lapine...
Read more >
libhdf5.so - Google Groups
Hello, · Upon a successful installation of the VOTCA's development (master) branch I get this error: · ~/votca-dev/bin/csg_map · I tried to reinstall...
Read more >
linux - Cannot install libhdf5-dev (or any hdf5 dependency) on ...
I have made sure 'main, universe, restricted, multiverse' repositories are all enabled, both from sources.list and from the Ubuntu Software GUI.
Read more >
Error when Compiling HDF5 with Intel C/C++/Fortran compilers
src/.libs/libhdf5.so, not found (try using -rpath or -rpath-link) ... I am on Ubuntu version 14.04, using Intel compiler 16.0.2. Thanks. Translate.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found