Opened 6 years ago

Closed 4 years ago

#57146 closed defect (wontfix)

h5py Library not updated

Reported by: boatmorrow Owned by: eborisch (Eric A. Borisch)
Priority: Normal Milestone:
Component: ports Version: 2.5.3
Keywords: Cc: boatmorrow, Dave-Allured (Dave Allured)
Port: py-h5py

Description (last modified by mf2k (Frank Schima))

Hello,

I've installed py-h5py. It worked until I recently upgraded all ports with "port upgrade outdated". Now when I try to import h5py I get:

$ python -c "import h5py"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/__init__.py", line 26, in <module>
    from . import _errors
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/_errors.so, 2): Library not loaded: @loader_path/.dylibs/libhdf5.101.dylib
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/_errors.so
  Reason: Incompatible library version: _errors.so requires version 103.0.0 or later, but libhdf5.101.dylib provides version 102.0.0

I've tried

sudo port -nR upgrade --force py-h5py

I've also tried uninstalling and reinstalling. I'm wondering if a library needs to be updated in the port?

Thanks, Payton

Change History (12)

comment:1 Changed 6 years ago by mf2k (Frank Schima)

In the future, please use WikiFormatting and add the port maintainer(s) to Cc (port info --maintainers py-h5py), if any.

comment:2 Changed 6 years ago by mf2k (Frank Schima)

Description: modified (diff)
Keywords: h5py hdf5 removed
Owner: set to eborisch
Status: newassigned

comment:3 Changed 6 years ago by jmroot (Joshua Root)

What version of the hdf5 port is installed?

comment:4 Changed 6 years ago by jmroot (Joshua Root)

Also, it seems incorrect for your _errors.so to be using @loader_path in its load commands. In the archive of py27-h5py, for darwin 13 at least, an absolute path is used. Is there a .dylibs directory in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/? If so, where did it come from? (That's also not present in the archive.)

comment:5 Changed 6 years ago by eborisch (Eric A. Borisch)

You don't have any HDF5 installation in /usr/local do you? Make sure you clear that out if you do.

start with sudo port selfupdate && sudo port upgrade outdated. After doing that, perform sudo port uninstall py27-h5py && sudo port -s install py27-h5py. If that still doesn't work, see if sudo port uninstall py27-h5py && sudo port -ts install py27-h5py gives you a working installation.

Let us know if is '-t' that fixes it -- that would indicate it is an issue with h5py's build grabbing external libraries. (Again, most likely if something is in /usr/local.)

comment:6 Changed 6 years ago by boatmorrow

All ports are upgraded.

Version is py-h5py @2.8.0_1

I see no hdf5 in /usr/local, but a version is loaded for another program in a home directory. I don'y think h5py would look there.

There is a .dylib folder in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/

Could it be from a pip install? I tried that when this h5py didn't work - pip is from macports - and I have run pip uninstall h5py.

Tried all the uninstall and reinstall from above. I am still getting:

python -c "import h5py"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/__init__.py", line 26, in <module>
    from . import _errors
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/_errors.so, 2): Library not loaded: /opt/local/lib/libhdf5.101.dylib
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/_errors.so
  Reason: Incompatible library version: _errors.so requires version 103.0.0 or later, but libhdf5.101.dylib provides version 102.0.0
Last edited 6 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:7 Changed 6 years ago by eborisch (Eric A. Borisch)

Output of port list installed and hdf5 ? The confusion I'm having is that my up-to-date hdf5 (1.10.2) shows library version 103.0.0 for /opt/local/lib/libhdf5.101.dylib.

I'm guessing you haven't tried uninstalling and then sudo port install -s py27-h5py? There is a mismatch from your compiled .so and your system, forcing a build from source locally should resolve that. (But leaves unanswered why you don't appear to have the latest version.)

OS version? Xcode version?

comment:8 in reply to:  6 Changed 6 years ago by jmroot (Joshua Root)

Replying to boatmorrow:

There is a .dylib folder in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/

Could it be from a pip install? I tried that when this h5py didn't work - pip is from macports - and I have run pip uninstall h5py.

Installing into the macports python prefix with pip is a problem; pip and macports will have different ideas about what is currently installed. The problematic files here do indeed appear to be from the binary wheel of h5py on pypi.

At minimum you need to deactivate py27-h5py, then remove all remaining traces of the version installed with pip, then finally reactivate the port.

comment:9 Changed 6 years ago by boatmorrow

Hello,

I'm guessing the pip install is the problem. I've tried to remove all vestige of the pip install, but I can't seem to find all it. I've uninstalled h5py via pip. I've then uninstalled the py27-h5py. A grep of h5py on /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ returns nothing, so wherever it is it isn't there. I then to a reinstall with sudo port install -s py27-h5py.

Somewhere its still finding the offending libraries, because I still get:

python -c "import h5py"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/__init__.py", line 26, in <module>
    from . import _errors
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/_errors.so, 2): Library not loaded: /opt/local/lib/libhdf5.101.dylib
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/_errors.so
  Reason: Incompatible library version: _errors.so requires version 103.0.0 or later, but libhdf5.101.dylib provides version 102.0.0

However, I think this isn't a bug in the port but in my system, so I think its my problem not yours. I think I installed some packages with fairly heavy dependencies using pip, and now I'm in trouble for using two different package managers - lesson learned.

Thanks for your time, I appreciate the help.

Last edited 6 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:10 Changed 6 years ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:11 in reply to:  7 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to eborisch:

Output of port list installed and hdf5 ? The confusion I'm having is that my up-to-date hdf5 (1.10.2) shows library version 103.0.0 for /opt/local/lib/libhdf5.101.dylib.

port list doesn't do what you think it does. See wiki:FAQ#portlist. You should use port installed hdf5 here instead.

I'm guessing you haven't tried uninstalling and then sudo port install -s py27-h5py? There is a mismatch from your compiled .so and your system, forcing a build from source locally should resolve that. (But leaves unanswered why you don't appear to have the latest version.)

Single-letter flags like -s are "global" and not related to specific port subcommands, and must therefore appear before the subcommand, otherwise they don't do anything. So you'd need sudo port -s install py27-h5py here instead.

comment:12 Changed 4 years ago by eborisch (Eric A. Borisch)

Resolution: wontfix
Status: assignedclosed
Note: See TracTickets for help on using tickets.