Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pytables installation failed

I do:

sudo pip install --upgrade tables

I get:

    /usr/bin/ld: cannot find -lhdf5
collect2: ld returned 1 exit status
.. 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:
/usr/bin/ld: cannot find -lhdf5

however:

$ echo $HDF5_DIR 
/opt/hdf5/
$ ls /opt/hdf5/
bin  include  lib  share
$ ls /opt/hdf5/lib/
libhdf5.a     libhdf5_hl.la  libhdf5_hl.so.8      libhdf5.la        libhdf5.so libhdf5.so.8.0.1
libhdf5_hl.a  libhdf5_hl.so  libhdf5_hl.so.8.0.1  libhdf5.settings  libhdf5.so.8

What's wrong? How to debug? I already tried to set HDF5_DIR to /opt/ or to /opt/hdf5/lib.

like image 842
Emanuele Paolini Avatar asked Dec 05 '22 07:12

Emanuele Paolini


2 Answers

I also had the same error on Debian sid trying to work in a local virtualenv. To work around it I did:

apt-get build-dep python-tables
HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/ && pip install tables

... now it's working.

like image 107
csirac2 Avatar answered Dec 08 '22 04:12

csirac2


I was able to fix this easily in OSX with virtual environments using the following code:

    $ brew install hdf5
    $ pyvenv test
    $ workon myvenv # to get pytables working within the virtual environment myvenv
    $ pip install numpy numexpr cython
    $ pip install tables

(taken from andreabedini post in https://github.com/PyTables/PyTables/issues/385)

like image 44
Jorge Aurelio Menendez Avatar answered Dec 08 '22 06:12

Jorge Aurelio Menendez