Installing h5py on an Ubuntu server

前端 未结 5 1184
一个人的身影
一个人的身影 2020-12-14 00:03

I was installing h5py on an Ubuntu server. However it seems to return an error that h5py.h is not found. It gives the same error message when I install it using

相关标签:
5条回答
  • 2020-12-14 00:35

    You need to install libhdf5-dev to get the required header files. Just run

    sudo apt-get install libhdf5-dev
    

    and it should install it and its dependencies automatically.

    Don't worry about the NumPy warning, it just means that the package developers are using an old version of the API, but everything will still work.

    0 讨论(0)
  • 2020-12-14 00:47

    In my case (Ubuntu 15.04) installing libhdf5-dev was not enough.

    I had to run:

    HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/ pip install h5py

    to make it work.

    0 讨论(0)
  • 2020-12-14 00:51

    You can use python-h5py.

    sudo apt-get install python-h5py

    And then in your Python file try:

    import h5py

    0 讨论(0)
  • 2020-12-14 00:53

    I had to install both libhdf5-dev and cython3 (Ubuntu 18.04 on arm64 device, Python 3.5).

    sudo apt install libhdf5-dev
    sudo apt install cython3
    
    0 讨论(0)
  • 2020-12-14 00:54

    It is generally preferable to use pip instead of installing it manually, since pip will also install all python dependencies. You would still need your header files though.

    so:

    sudo apt-get install libhdf5-dev
    pip install h5py
    
    0 讨论(0)
提交回复
热议问题