gauteh/lieer

Error after installing on ARM mac

quarkw opened this issue · 6 comments

I get the following error after running pip install . and then gmi

Has anyone else gotten lieer to work on an ARM based mac? I'm not sure what exactly I'm doing wrong.

Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniconda/base/envs/lieer/lib/python3.10/site-packages/notmuch/globals.py", line 28, in <module>
    nmlib = CDLL("libnotmuch.{0:s}.dylib".format(SOVERSION))
  File "/opt/homebrew/Caskroom/miniconda/base/envs/lieer/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(libnotmuch.5.dylib, 0x0006): tried: '/opt/homebrew/Caskroom/miniconda/base/envs/lieer/lib/libnotmuch.5.dylib' (no such file), '/opt/homebrew/Caskroom/miniconda/base/envs/lieer/lib/libnotmuch.5.dylib' (no such file), '/opt/homebrew/Caskroom/miniconda/base/envs/lieer/lib/python3.10/lib-dynload/../../libnotmuch.5.dylib' (no such file), '/opt/homebrew/Caskroom/miniconda/base/envs/lieer/lib/libnotmuch.5.dylib' (no such file), '/opt/homebrew/Caskroom/miniconda/base/envs/lieer/bin/../lib/libnotmuch.5.dylib' (no such file), 'libnotmuch.5.dylib' (no such file), '/usr/local/lib/libnotmuch.5.dylib' (no such file), '/usr/lib/libnotmuch.5.dylib' (no such file)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniconda/base/envs/lieer/bin/gmi", line 20, in <module>
    from lieer import Gmailieer
  File "/opt/homebrew/Caskroom/miniconda/base/envs/lieer/lib/python3.10/site-packages/lieer/__init__.py", line 1, in <module>
    from .gmailieer import *
  File "/opt/homebrew/Caskroom/miniconda/base/envs/lieer/lib/python3.10/site-packages/lieer/gmailieer.py", line 26, in <module>
    import  notmuch
  File "/opt/homebrew/Caskroom/miniconda/base/envs/lieer/lib/python3.10/site-packages/notmuch/__init__.py", line 54, in <module>
    from .database import Database
  File "/opt/homebrew/Caskroom/miniconda/base/envs/lieer/lib/python3.10/site-packages/notmuch/database.py", line 25, in <module>
    from .globals import (
  File "/opt/homebrew/Caskroom/miniconda/base/envs/lieer/lib/python3.10/site-packages/notmuch/globals.py", line 32, in <module>
    raise ImportError("Could not find shared 'notmuch' library.")
ImportError: Could not find shared 'notmuch' library.

I'm getting the same error !

I'm getting the same error !

@RobinBeekhof

I was able to workaround by installing a pre-compiled binary using nix:
nix-env -iA nixpkgs.lieer

It doesn't fix this issue, but was able to unblock me

I tried via nix, but now I get the following error:

Traceback (most recent call last): File "/nix/store/2kp08g6f0nz95rfwxg2d9kdfcj9xdh35-lieer-1.3/bin/.gmi-wrapped", line 25, in <module> g.main () File "/nix/store/2kp08g6f0nz95rfwxg2d9kdfcj9xdh35-lieer-1.3/lib/python3.9/site-packages/lieer/gmailieer.py", line 212, in main args.func (args) File "/nix/store/2kp08g6f0nz95rfwxg2d9kdfcj9xdh35-lieer-1.3/lib/python3.9/site-packages/lieer/gmailieer.py", line 391, in pull self.setup (args, args.dry_run, True) File "/nix/store/2kp08g6f0nz95rfwxg2d9kdfcj9xdh35-lieer-1.3/lib/python3.9/site-packages/lieer/gmailieer.py", line 278, in setup self.local.load_repository (block) File "/nix/store/2kp08g6f0nz95rfwxg2d9kdfcj9xdh35-lieer-1.3/lib/python3.9/site-packages/lieer/local.py", line 311, in load_repository self.new_tags = self.nmconfig['new']['tags'].split (';') File "/nix/store/d7jippcwf15x0fvqr9bglgmnb4ci9srb-python3-3.9.12/lib/python3.9/configparser.py", line 1257, in __getitem__ raise KeyError(key) KeyError: 'tags'

The problem for me was I installed notmuch through brew, but somehow the library installed by brew is not included by miniconda's python.

This fixed it for me:

export DYLD_FALLBACK_LIBRARY_PATH="$DYLD_FALLBACK_LIBRARY_PATH:$(brew --prefix)/lib"

You can add it to your shell's init file.

Looks like this issue is related to the notmuch bindings and its C library.

agzam commented

After installing notmuch with homebrew, it tells you right there to modify PYTHONPATH, i.e.,

export PYTHONPATH="$PYTHONPATH:$(brew --prefix)/opt/notmuch/libexec/lib/python3.11/site-packages"

Setting that fixed the installation problem for me