Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX Instructions #267

Open
agzam opened this issue Dec 1, 2023 · 11 comments
Open

OSX Instructions #267

agzam opened this issue Dec 1, 2023 · 11 comments

Comments

@agzam
Copy link

agzam commented Dec 1, 2023

Can someone please share how they do it on a Mac? I have to use a Mac (not by choice) and with every update something Python-related breaks in the system. This time it was the latest Sonoma patch.
I can never get the notmuch2 bindings installed properly.
I would appreciate it if someone shared their workaround for Mac. Thanks.

Log excerps
        Building wheels for collected packages: lieer, notmuch2
        Building wheel for lieer (setup.py) ... done
        Created wheel for lieer: filename=lieer-1.6-py3-none-any.whl size=47110 sha256=0e07f2c606f06e52e7e0bcbf0c1a2858f72dcc1f2ecf7bbd07fe5cccce87e101
        Stored in directory: /private/var/folders/v9/jfn5y8zd2xn06ggtrjxnrnq40000gn/T/pip-ephem-wheel-cache-1j2mmaky/wheels/08/4c/77/6a2b7e035ac8e9c5cdab9ab7cee273b2a43683cd69f707c359
        Building wheel for notmuch2 (setup.py) ... error
        error: subprocess-exited-with-error

        × python setup.py bdist_wheel did not run successfully.
        │ exit code: 1
        ╰─> [38 lines of output]
            /opt/homebrew/lib/python3.11/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
            !!

                    ********************************************************************************
                    Requirements should be satisfied by a PEP 517 installer.
                    If you are using pip, you can try `pip install --use-pep517`.
                    ********************************************************************************

            !!
                dist.fetch_build_eggs(dist.setup_requires)
            running bdist_wheel
            running build
            running build_py
            creating build
            creating build/lib.macosx-14-arm64-cpython-311
            creating build/lib.macosx-14-arm64-cpython-311/notmuch2
            copying notmuch2/_base.py -> build/lib.macosx-14-arm64-cpython-311/notmuch2
            copying notmuch2/_errors.py -> build/lib.macosx-14-arm64-cpython-311/notmuch2
            copying notmuch2/_query.py -> build/lib.macosx-14-arm64-cpython-311/notmuch2
            copying notmuch2/__init__.py -> build/lib.macosx-14-arm64-cpython-311/notmuch2
            copying notmuch2/_build.py -> build/lib.macosx-14-arm64-cpython-311/notmuch2
            copying notmuch2/_database.py -> build/lib.macosx-14-arm64-cpython-311/notmuch2
            copying notmuch2/_message.py -> build/lib.macosx-14-arm64-cpython-311/notmuch2
            copying notmuch2/_config.py -> build/lib.macosx-14-arm64-cpython-311/notmuch2
            copying notmuch2/_thread.py -> build/lib.macosx-14-arm64-cpython-311/notmuch2
            copying notmuch2/_tags.py -> build/lib.macosx-14-arm64-cpython-311/notmuch2
            running build_ext
            generating cffi module 'build/temp.macosx-14-arm64-cpython-311/notmuch2._capi.c'
            creating build/temp.macosx-14-arm64-cpython-311
            building 'notmuch2._capi' extension
            creating build/temp.macosx-14-arm64-cpython-311/build
            creating build/temp.macosx-14-arm64-cpython-311/build/temp.macosx-14-arm64-cpython-311
            clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -I../../lib -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c build/temp.macosx-14-arm64-cpython-311/notmuch2._capi.c -o build/temp.macosx-14-arm64-cpython-311/build/temp.macosx-14-arm64-cpython-311/notmuch2._capi.o
            build/temp.macosx-14-arm64-cpython-311/notmuch2._capi.c:572:14: fatal error: 'notmuch.h' file not found
                #include <notmuch.h>
                        ^~~~~~~~~~~
            1 error generated.
            error: command '/usr/bin/clang' failed with exit code 1
            [end of output]
@gauteh
Copy link
Owner

gauteh commented Dec 1, 2023

I generally recommended miniforge. Make a separate notmuch environment.

@paralin
Copy link

paralin commented Dec 19, 2023

notmuch.h is not available on MacOS, not sure how to get the dev header installed.

@rhstanton
Copy link

I had the same problem. Then I tried uninstalling the MacPorts version of notmuch and installing the Homebrew version instead (brew install notmuch) and lieer installed fine.

@rhstanton
Copy link

Here are step-by-step instructions. Note that the default Python installation is now 3.12, which doesn't seem to work with leeir, so I specify 3.10 below:

  • brew install notmuch
  • conda create -n mail python=3.10
  • conda activate mail
  • pip install google-api-python-client google_auth_oauthlib
  • git clone [email protected]:gauteh/lieer.git
  • cd lieer
  • git checkout v1.3
  • pip install .

And you should be done!

@listx
Copy link

listx commented Apr 18, 2024

I generally recommended miniforge. Make a separate notmuch environment.

Could you provide some explicit instructions about making this work?

@gauteh
Copy link
Owner

gauteh commented Apr 18, 2024 via email

@listx
Copy link

listx commented Apr 18, 2024

@gauteh Thanks. I actually got lucky and realized that lieer is already packaged in Nixpkgs https://github.com/NixOS/nixpkgs/blob/nixos-23.11/pkgs/applications/networking/lieer/default.nix#L34 so I just installed that on OSX (e.g., nix-env -iA nixpkgs.lieer) and it's working. Cheers

@gauteh
Copy link
Owner

gauteh commented Apr 18, 2024 via email

@HomoElectromagneticus
Copy link

I am also having trouble with this on MacOS. By checking out v1.3, I was able to install lieer, however I was unable to pull in email due to an error at the 2FA step with Google. Trying to install the latest version produces the same error for me as in agzam's original message here. I'm not familiar with the python / conda / mamba ecosystem or virtual environments in general, and thus my attempts at figuring it out on my own have been unsuccessful. Any assistance would be very appreciated - thanks!

@jerudnik
Copy link

jerudnik commented Jul 5, 2024

Confirming that nix also worked for me!

@mikecsmith
Copy link

Easiest way to get it to build is including the notmuch.h file via the CFLAGS env var i.e.

CFLAGS="-I$(brew --prefix)/opt/notmuch/include" pip install .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants