0

When installing the Fuel machine learning library, I got stuck with some dependencies issues:

alvas@ubi:~$ pip install --upgrade git+git://github.com/mila-udem/fuel.gitYou are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting git+git://github.com/mila-udem/fuel.git
  Cloning git://github.com/mila-udem/fuel.git to /tmp/pip-xUlqCT-build
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Collecting numpy (from fuel==0.0.1)
Requirement already up-to-date: six in /usr/local/lib/python2.7/dist-packages (from fuel==0.0.1)
Collecting picklable-itertools (from fuel==0.0.1)
  Downloading picklable-itertools-0.1.1.tar.gz
Collecting pyyaml (from fuel==0.0.1)
  Downloading PyYAML-3.11.tar.gz (248kB)
    100% |████████████████████████████████| 249kB 612kB/s 
Collecting h5py (from fuel==0.0.1)
  Downloading h5py-2.5.0.tar.gz (684kB)
    100% |████████████████████████████████| 688kB 398kB/s 
Collecting tables (from fuel==0.0.1)
  Downloading tables-3.2.2.tar.gz (7.0MB)
    100% |████████████████████████████████| 7.0MB 73kB/s 
    Complete output from command python setup.py egg_info:
    /usr/bin/ld: cannot find -lhdf5
    collect2: error: ld returned 1 exit status
    * Using Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    * USE_PKGCONFIG: True
    .. 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-wMS1d3/tables

Then after I have done (Installing h5py on an Ubuntu server):

sudo apt-get install libhdf5-dev
sudo HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/ pip install h5py

And then I had to also update my cython with:

sudo pip install cython

My question is not about how to fix the installation issues but what does this command mean?

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

What does specifying the HDF5_DIR do?

Why didn't the fuel dependencies automatically install from the:

What should I do to update the setup.py from fuel so that it can automatically pip install the dependencies?

Community
  • 1
  • 1
alvas
  • 115,346
  • 109
  • 446
  • 738

1 Answers1

1

You do not need to make any modifications to the setup.py from fuel. Just make sure HDF5_DIR is set correctly before updating the lib.

Explanations:

If you look at your error log, you can see that it fails at installing the h5py python lib that is a dependency of fuel. It also tells you why it failed at the end, basically it is because h5py use the C library hdf5 and it needs the headers of this lib to use it. So the sudo apt-get install libhdf5-dev that you executed is to install the development version of this C library (you can gess that by the -dev). The dev versions install the headers of the lib and not just the compiled lib. Then, the HDF5_DIR env variable is nedded to tell h5py setup where to find those headers.

So if you whant to update the fuel lib next time, make sure that the HDF5_DIR is set correctly and then it will update its dependencies (including h5py).

Arimaz
  • 61
  • 2