Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

Could not find a llvm-config binary on Mac M1 #49

Open
eleonoravercesi opened this issue Dec 7, 2021 · 3 comments
Open

Could not find a llvm-config binary on Mac M1 #49

eleonoravercesi opened this issue Dec 7, 2021 · 3 comments

Comments

@eleonoravercesi
Copy link

eleonoravercesi commented Dec 7, 2021

Hi, I am trying to install pymde on a MacBook Air with an M1 chip. I have tried both in a virtual environment and globally.

System Version: macOS 12.0.1
Kernel Version: Darwin 21.1.0
/usr/bin/python3 --version
Python 3.8.2

However, I am always facing the same issue.

   ERROR: Command errored out with exit status 1:
     command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/y_/5kkrlhbj2v1bch8snxxws28c0000gn/T/pip-install-h05etips/llvmlite_698138ee5d98423b8959abdddb1d07cd/setup.py'"'"'; __file__='"'"'/private/var/folders/y_/5kkrlhbj2v1bch8snxxws28c0000gn/T/pip-install-h05etips/llvmlite_698138ee5d98423b8959abdddb1d07cd/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/y_/5kkrlhbj2v1bch8snxxws28c0000gn/T/pip-record-veev5qpz/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/eleonoravercesi/Library/Python/3.8/include/python3.8/llvmlite
         cwd: /private/var/folders/y_/5kkrlhbj2v1bch8snxxws28c0000gn/T/pip-install-h05etips/llvmlite_698138ee5d98423b8959abdddb1d07cd/
    Complete output (14 lines):
    running install
    running build
    got version from file /private/var/folders/y_/5kkrlhbj2v1bch8snxxws28c0000gn/T/pip-install-h05etips/llvmlite_698138ee5d98423b8959abdddb1d07cd/llvmlite/_version.py {'version': '0.37.0', 'full': 'd77dc1bcdb5af040c549f4d1ceeb4db7c8d08718'}
    running build_ext
    /Library/Developer/CommandLineTools/usr/bin/python3 /private/var/folders/y_/5kkrlhbj2v1bch8snxxws28c0000gn/T/pip-install-h05etips/llvmlite_698138ee5d98423b8959abdddb1d07cd/ffi/build.py
    LLVM version... Traceback (most recent call last):
      File "/private/var/folders/y_/5kkrlhbj2v1bch8snxxws28c0000gn/T/pip-install-h05etips/llvmlite_698138ee5d98423b8959abdddb1d07cd/ffi/build.py", line 220, in <module>
        main()
      File "/private/var/folders/y_/5kkrlhbj2v1bch8snxxws28c0000gn/T/pip-install-h05etips/llvmlite_698138ee5d98423b8959abdddb1d07cd/ffi/build.py", line 214, in main
        main_posix('osx', '.dylib')
      File "/private/var/folders/y_/5kkrlhbj2v1bch8snxxws28c0000gn/T/pip-install-h05etips/llvmlite_698138ee5d98423b8959abdddb1d07cd/ffi/build.py", line 134, in main_posix
        raise RuntimeError(msg) from None
    RuntimeError: Could not find a `llvm-config` binary. There are a number of reasons this could occur, please see: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#using-pip for help.
    error: command '/Library/Developer/CommandLineTools/usr/bin/python3' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/y_/5kkrlhbj2v1bch8snxxws28c0000gn/T/pip-install-h05etips/llvmlite_698138ee5d98423b8959abdddb1d07cd/setup.py'"'"'; __file__='"'"'/private/var/folders/y_/5kkrlhbj2v1bch8snxxws28c0000gn/T/pip-install-h05etips/llvmlite_698138ee5d98423b8959abdddb1d07cd/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/y_/5kkrlhbj2v1bch8snxxws28c0000gn/T/pip-record-veev5qpz/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/eleonoravercesi/Library/Python/3.8/include/python3.8/llvmlite Check the logs for full command output.

Thank you!

@eleonoravercesi eleonoravercesi changed the title Failed building wheel for llvmlite on Mac M1 Could not find a llvm-config binary on Mac M1 Dec 7, 2021
@eleonoravercesi
Copy link
Author

After a little search, I have solved my issue with the following steps.

  1. Instead of using Mac python3 (/usr/bin/python3), I have started using brew python3 (/opt/homebrew/bin/python3).
  2. I have installed llvm@11 using brew
brew install llvm@11
  1. Then, I have manually installed llvmlite by specifying the llvm-config path (found on GitHub):
LLVM_CONFIG="/opt/homebrew/Cellar/llvm@11/11.1.0_3/bin/llvm-config" arch -arm64 python3 -m pip install llvmlite
  1. Lastly, I succeeded to install pymde:
python3 -m pip install pymde

Not sure this is the shortest and cleverest way, but it is the first way that perfectly works for me among the ones I tried!

@akshayka
Copy link
Member

Sorry for the delay, and thank you for posting the solution!

I think this is likely due to the dependency on pynndescent, which uses numba, which in turn uses llvm for just-in-time code generation.

I will take closer look, and perhaps update the installation directions to point to your above comment.

Thank you!

@kyleford8
Copy link

For what it's worth, I had the same issue, and can confirm the solution posted above works (been a while since I installed numba, but I remember having to do something nearly identical with llvmlite). In my case, it was definitely a numba/llvm issue, which also affects installation of UMAP (and probably many other packages) on M1 Macs.

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

3 participants