2014-02-06 286 views
1

我做的:pytables安装失败

sudo pip install --upgrade tables 

我得到:

/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 

但是:

$ 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 

有什么不对?如何调试?我已经尝试将HDF5_DIR设置为/ opt /或/ opt/hdf5/lib。

回答

0

我有类似的问题,但我使用领先优势而不是点子释放(见旁白)。 我也试过指着库本身

export HDF5_DIR=/usr/lib/libhdf5.so.6 

但它没有工作。

旁白:您可以尝试PyTables的领先优势,如果你认为你的错误可能最近已解决:

sudo pip install git+https://github.com/PyTables/PyTables 

在我安装hdf5库(libhdf5-openmpi-dev)的开发版本后,构建(这是由pip安装引起的)似乎进一步发展。由于其他原因,构建仍然失败,但这是您可以尝试的另一个方向。

+2

'HDF5_DIR'需要一个目录而不是一个文件,' export HDF5_DIR =/local/johndoe/hdf5' – minerals

7

我也在Debian sid上尝试在本地virtualenv中工作时出现同样的错误。要解决它,我做了:

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

...现在它的工作。

+1

'sudo apt-get build-dep python-tables'对我来说已经足够了! (Ubuntu 14.04) – emmagras

+1

我所要做的只是'sudo apt-get install hdf5-serial-dev',然后是'pip install tables'。 –

+0

自2014年以来,很多内容已经发生变化,很高兴知道-dev包现在可以用于pytables了:) – csirac2

2

我能够在OSX使用下面的代码虚拟环境中轻松解决这个问题:

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

(在https://github.com/PyTables/PyTables/issues/385从andreabedini后取)