[bug] Python bindings fail to load shared libraries in MacOS El Capitan

Robert Künnemann robert at kunnemann.de
Mon Oct 19 04:53:21 PDT 2015


Hi!

The python bindings fail to load libnotmuch with the new version of
MacOS X (10.11). Running "afew", a tagger written in Python gives:

Traceback (most recent call last):
  File "/usr/local/Cellar/afew/HEAD/libexec/bin/afew", line 9, in <module>
    load_entry_point('afew==0.0.0', 'console_scripts', 'afew')()
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 356, in load_entry_point
    """Return `name` entry point of `group` for `dist` or raise ImportError"""
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 2476, in load_entry_point
    except ValueError:
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources.py", line 2190, in load
    parse_map = classmethod(parse_map)
  File "/Library/Python/2.7/site-packages/afew-0.0.0-py2.7.egg/afew/commands.py", line 27, in <module>
    from afew.Database import Database
  File "/Library/Python/2.7/site-packages/afew-0.0.0-py2.7.egg/afew/Database.py", line 23, in <module>
    import notmuch
  File "/usr/local/lib/python2.7/site-packages/notmuch/__init__.py", line 54, in <module>
    from .database import Database
  File "/usr/local/lib/python2.7/site-packages/notmuch/database.py", line 24, in <module>
    from .globals import (
  File "/usr/local/lib/python2.7/site-packages/notmuch/globals.py", line 32, in <module>
    raise ImportError("Could not find shared 'notmuch' library.")
ImportError: Could not find shared 'notmuch' library.

Setting DYLD_FALLBACK_LIBRARY_PATH to /usr/local/lib (where
libnotmuch4.dylib resides) did not help.

As Eric Wang's response in this thread suggested
http://stackoverflow.com/questions/32905322/oserror-dlopenlibsystem-dylib-6-image-not-found
I've substituted 

nmlib = CDLL("libnotmuch.so.{0:s}".format(SOVERSION))

in globals.py

nmlib = CDLL("/usr/local/lib/libnotmuch.{0:s}.dylib".format(SOVERSION))

This resolved the problem for me.

With kind regards, Robert Künnemann


More information about the notmuch mailing list