libmfhdf.so.0 not found

1,110 views
Skip to first unread message

Mariana Scott

unread,
Aug 25, 2016, 10:38:44 AM8/25/16
to Py-ART Users
I followed the installation instructions from https://github.com/ARM-DOE/pyart/wiki/Simple-Install-of-Py-ART-using-Anaconda
to install PyArt on a brand new CentOS 6.8 machine. The installation seemed to work ok. However I'm getting the following error:

Error in import pyart
from . import core
from .radar import Radar
from netCDF4 import num2date, date2num
from ._netCDF4 import *
ImportError: libmfhdf.so.0: cannot open shared object file: No such file or directory.


Are there any libraries that I may need that was not mentioned in the Anaconda install site?
Thanks :)
Mariana

Scott Collis

unread,
Aug 25, 2016, 10:40:28 AM8/25/16
to Mariana Scott, Py-ART Users
Hey Mariana,
What is the output of ‘which python’?

Try conda install h5py


Dr Scott Collis
Purveyor of lofty observations (Atmospheric Scientist) 
Environmental Science Division
Argonne National Laboratory
Mb: +1 630 235 8025
Of: +1 630 252 0550
Become a Py-ART user today! 
http://arm-doe.github.io/pyart/

--
You received this message because you are subscribed to the Google Groups "Py-ART Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyart-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mariana Scott

unread,
Aug 25, 2016, 12:40:57 PM8/25/16
to Py-ART Users, feli...@gmail.com
Output of which python: /usr/local/bin/python2.7  (I set up an alias since the default is 2.6)

in Spyder, it is Python 2.7.12 |Anaconda custom (64-bit)|

When I did a conda install h5py I got a message saying the package was already installed.

In Googleing this problem, it seems like I should find this file and set it to LD_LIBRARY_PATH. However, I don't have this file, just

libmfhdf.a and libmfhdf.la which are part of anaconda lib and hdf4 anaconda lib.


-Mariana

Scott Collis

unread,
Aug 25, 2016, 12:44:35 PM8/25/16
to Mariana Scott, Py-ART Users
Looks to me to be some conflicts between your system python and anaconda. 

I always install anaconda as a user (not root) and it goes in my home directory..

eg: 
[scollis@blogin3 ~]$ which python
/homes/scollis/anaconda/bin/python
[scollis@blogin3 ~]$ 

I would suggest instilling anaconda as user and when it offers to update your bashrc (or other rc) say yes. 

This also gives you access to conda environments which are stupidly useful. 



Dr Scott Collis
Purveyor of lofty observations (Atmospheric Scientist) 
Environmental Science Division
Argonne National Laboratory
Mb: +1 630 235 8025
Of: +1 630 252 0550
Become a Py-ART user today! 
http://arm-doe.github.io/pyart/

Mariana Scott

unread,
Aug 25, 2016, 3:31:15 PM8/25/16
to Py-ART Users, feli...@gmail.com
I installed it as a user, so its in my /home/ directory (and I have a comment about the anaconda added line in my bashrc, followed by that $PATH)
I removed the alias in the bashrc file and now which python points to ~/anaconda2/bin/python

I have also yum installed netCDF-devel, hdf-devel, hdf5-devel... didn't help matters, and I still see "

ImportError: libmfhdf.so.0: cannot open shared object file: No such file or directory"



I'll keep trying new things and will post back if I find a solution.


-Mariana

Mariana Scott

unread,
Aug 25, 2016, 4:22:49 PM8/25/16
to Py-ART Users, feli...@gmail.com
Just as an addition to all of this, looking at the shared object dependencies for _netCDF4.so:
$ ldd _netCDF4.so
    linux-vdso.so.1 =>  (0x00007fffc2e00000)
    libnetcdf.so.11 => /home/mfs/anaconda2/lib/python2.7/site-packages/netCDF4/./../../../libnetcdf.so.11 (0x00007f2309c60000)
    libpython2.7.so.1.0 => /home/mfs/anaconda2/lib/python2.7/site-packages/netCDF4/./../../../libpython2.7.so.1.0 (0x00007f2309860000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f2309628000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f2309290000)
    libmfhdf.so.0 => not found
    libdf.so.0 => not found
    .
    .
    .

I have found static libraries that were added by Anaconda, but this is calling for shared libraries.

The plan of action is to uninstall the yum-installed hdf, hdf5, and netCDF libraries and install hdf and hdf5 from source with --enable-shared --disable-fortran flags as specified by the developers.
Wish me luck.
Mariana

Mariana Scott

unread,
Aug 26, 2016, 10:45:09 AM8/26/16
to Py-ART Users, feli...@gmail.com
As a follow-up to future users:

The library was looking for libmfhdf.so.0, which comes from a HDF5 installation with shared libraries. No matter what I did, only the static libraries were getting installed (from Conda, yum, even installing from source).

As a last resort, I did an rpm install of HDF5 (from https://www.rpmfind.net/linux/rpm2html/search.php?query=libmfhdf.so.0%28%29%2864bit%29) and that solved the issue by placing libmfhdf.so.0 in my shared libraries.

I then added the directory where this file was placed (in my case it was in /usr/lib64/) to $PATH and $LD_LIBRARY_PATH in my .bashrc and sourced the file. This solved my problem.

I hope that helps someone in the future! If anyone sees any red flags with what I did, please let me know.
Cheers,
-Mariana

Jonathan Helmus

unread,
Aug 29, 2016, 3:11:36 PM8/29/16
to pyart...@googlegroups.com
Mariana,

    I believe the root cause of your issue was that the hdf4 package from my (jjhelmus) Anaconda Cloud channel.  This package is not compatible with one of the hdf5/libnetcdf/netcdf4 packages.  I have adjusted my channel so that this package should not be installed by default any more.  If you do have a system where this was installed you should be able to fix the import error using:

conda install hdf4

No rpm install of HDF5 should be needed, the version in the default conda repository works fine.  Sorry for the mix up.

Cheers,

    - Jonathan Helmus
Reply all
Reply to author
Forward
0 new messages