PyTables: pip tables install fails, HDF5 library not found
Hi PyTables team,
Thanks for an awesome package, and apologies in advance if I am overlooking something simple.
I’ve been trying install pytables via pip using pip install tables, however, it fails with an error Could not find a local HDF5 installation.:
Downloading/unpacking tables
Running setup.py egg_info for package tables
/tmp/H5closew4kVON.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main (int argc, char **argv) {
^~~~
/tmp/H5closew4kVON.c:2:5: warning: implicit declaration of function 'H5close' is invalid in C99 [-Wimplicit-function-declaration]
H5close();
^
2 warnings generated.
ld: library not found for -lhdf5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
* Found numpy 1.7.0 package installed.
* Found numexpr 2.0.1 package installed.
* Found Cython 0.18 package installed.
ld: library not found for -lhdf5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
.. ERROR:: Could not find a local HDF5 installation.
You may need to explicitly state where your local HDF5 headers and
library can be found by setting the ``HDF5_DIR`` environment
variable or by using the ``--hdf5`` command-line option.
Complete output from command python setup.py egg_info:
/tmp/H5closew4kVON.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main (int argc, char **argv) {
^~~~
/tmp/H5closew4kVON.c:2:5: warning: implicit declaration of function 'H5close' is invalid in C99 [-Wimplicit-function-declaration]
H5close();
^
2 warnings generated.
ld: library not found for -lhdf5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
* Found numpy 1.7.0 package installed.
* Found numexpr 2.0.1 package installed.
* Found Cython 0.18 package installed.
ld: library not found for -lhdf5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
.. ERROR:: Could not find a local HDF5 installation.
You may need to explicitly state where your local HDF5 headers and
library can be found by setting the ``HDF5_DIR`` environment
variable or by using the ``--hdf5`` command-line option.
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/tables
Storing complete log in /Users/nehalecky/.pip/pip.log
I do, however, have HDF5 installed via MacPorts, and can verify the installation with port contents hdf5-18:
Port hdf5-18 contains:
/opt/local/bin/gif2h5
/opt/local/bin/h52gif
/opt/local/bin/h5c++
/opt/local/bin/h5cc
/opt/local/bin/h5copy
/opt/local/bin/h5debug
...
/opt/local/include/H5ACpublic.h
/opt/local/include/H5AbstractDs.h
/opt/local/include/H5Apublic.h
/opt/local/include/H5ArrayType.h
/opt/local/include/H5AtomType.h
...
/opt/local/lib/libhdf5.7.dylib
/opt/local/lib/libhdf5.a
/opt/local/lib/libhdf5.dylib
/opt/local/lib/libhdf5.la
/opt/local/lib/libhdf5.settings
...
I’ve set env var HDF5_DIR in .bash_profile with export HDF5_DIR=/opt/local, but still no love from the pytables installation. I’ve been searching the interwebs for a solution, and finally decided to ask the source. Any help with this would be much appreciated, and thank you for your time!
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 39 (20 by maintainers)
Links to this issue
Commits related to this issue
- The library search path has been extended (see gh-219) — committed to avalentino/PyTables by avalentino 11 years ago
- Extend the include search path list for posix platforms (see gh-219) — committed to PyTables/PyTables by avalentino 11 years ago
Not sure if this helps anyone, but I got around this on OSX by installing
hdf5via homebrew with:then just
pip install --upgrade tablesFor anyone else who runs into this problem on Ubuntu (trusty in my case), I needed to
apt-get install libhdf5-devto get the header files, etc.Hi I am facing the same error as @Shreeyak on a M1 Mac, macOS Monterey
12.4,Python 3.10.3pip install tablesI tried to following the answer in this GitHub Issue:
Not sure if the paths are wrong given that Homebrew might handle
brew install hdf5on M1 Macs? I do have bothhdf5andc-blosccorrectly installed though.UPDATE:
Indeed, Homebrew puts the files into a different place on M1 Macs, the exports should be:
I just faced this error. Ubuntu 18.04, python 3.8.
I installed HDF5, but still got a similar error message. This time though, it detected the location of hdf5 install. Wonder why it still failed:
Maybe I needed to clear cache when installing via pip? Exporting env var HDF5_DIR solved it though:
aha, this worked. thank you! well, my
hdf5came with Anaconda distribution.