llvmlite: No such file or directory: 'llvm-config'

Hello,

I am trying to install llvmlite on MacOS Catalina for Python 3.8. I firstly used the pyCharm IDE it did not worked. I installed llvm and run pip3 install llvmlite

I am receiving an error message which says:

ERROR: Command errored out with exit status 1:
     command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-exq7k9p7/llvmlite/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-exq7k9p7/llvmlite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-9mvmoqq7/install-record.txt --single-version-externally-managed --compile
         cwd: /private/tmp/pip-install-exq7k9p7/llvmlite/
    Complete output (29 lines):
    running install
    running build
    got version from file /private/tmp/pip-install-exq7k9p7/llvmlite/llvmlite/_version.py {'version': '0.30.0', 'full': '3cad106e2f727bc400f1b426ce306b1e30e34b72'}
    running build_ext
    /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 /private/tmp/pip-install-exq7k9p7/llvmlite/ffi/build.py
    LLVM version... Traceback (most recent call last):
      File "/private/tmp/pip-install-exq7k9p7/llvmlite/ffi/build.py", line 105, in main_posix
        out = subprocess.check_output([llvm_config, '--version'])
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 411, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 489, in run
        with Popen(*popenargs, **kwargs) as process:
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 854, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 1702, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/private/tmp/pip-install-exq7k9p7/llvmlite/ffi/build.py", line 168, in <module>
        main()
      File "/private/tmp/pip-install-exq7k9p7/llvmlite/ffi/build.py", line 162, in main
        main_posix('osx', '.dylib')
      File "/private/tmp/pip-install-exq7k9p7/llvmlite/ffi/build.py", line 107, in main_posix
        raise RuntimeError("%s failed executing, please point LLVM_CONFIG "
    RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config
    error: command '/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-exq7k9p7/llvmlite/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-exq7k9p7/llvmlite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-9mvmoqq7/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

The config file exists and it is in this location: /usr/local/Cellar/llvm/9.0.0_1/include/llvm/config

I don’t know what am I doing wrong. I tried to reinstall llvm and link it. brew reinstall llvm brev link llvm

in that case, I receive another error:

`Warning: Refusing to link macOS-provided software: llvm
If you need to have llvm first in your PATH run:
  echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile

For compilers to find llvm you may need to set:
  export LDFLAGS="-L/usr/local/opt/llvm/lib"
  export CPPFLAGS="-I/usr/local/opt/llvm/include"`

I also tried to use this: $ sudo LLVM_CONFIG=/usr/local/Cellar/llvm/9.0.0_1/include/llvm/config/llvm-config.h pip3 install llvmlite

New error is:

ERROR: Command errored out with exit status 1:
     command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/36/wbzh7n_97jg1zk1ylzzfwqz80000gn/T/pip-install-rhijucgy/llvmlite/setup.py'"'"'; __file__='"'"'/private/var/folders/36/wbzh7n_97jg1zk1ylzzfwqz80000gn/T/pip-install-rhijucgy/llvmlite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/36/wbzh7n_97jg1zk1ylzzfwqz80000gn/T/pip-record-pcj1wmd6/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/36/wbzh7n_97jg1zk1ylzzfwqz80000gn/T/pip-install-rhijucgy/llvmlite/
    Complete output (18 lines):
    running install
    running build
    got version from file /private/var/folders/36/wbzh7n_97jg1zk1ylzzfwqz80000gn/T/pip-install-rhijucgy/llvmlite/llvmlite/_version.py {'version': '0.30.0', 'full': '3cad106e2f727bc400f1b426ce306b1e30e34b72'}
    running build_ext
    /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 /private/var/folders/36/wbzh7n_97jg1zk1ylzzfwqz80000gn/T/pip-install-rhijucgy/llvmlite/ffi/build.py
    LLVM version... 9.0.0
    
    Traceback (most recent call last):
      File "/private/var/folders/36/wbzh7n_97jg1zk1ylzzfwqz80000gn/T/pip-install-rhijucgy/llvmlite/ffi/build.py", line 168, in <module>
        main()
      File "/private/var/folders/36/wbzh7n_97jg1zk1ylzzfwqz80000gn/T/pip-install-rhijucgy/llvmlite/ffi/build.py", line 162, in main
        main_posix('osx', '.dylib')
      File "/private/var/folders/36/wbzh7n_97jg1zk1ylzzfwqz80000gn/T/pip-install-rhijucgy/llvmlite/ffi/build.py", line 120, in main_posix
        raise RuntimeError(msg)
    RuntimeError: Building llvmlite requires LLVM 7.0+ Be sure to set LLVM_CONFIG to the right executable path.
    Read the documentation at http://llvmlite.pydata.org/ for more information about building llvmlite.
    
    error: command '/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/36/wbzh7n_97jg1zk1ylzzfwqz80000gn/T/pip-install-rhijucgy/llvmlite/setup.py'"'"'; __file__='"'"'/private/var/folders/36/wbzh7n_97jg1zk1ylzzfwqz80000gn/T/pip-install-rhijucgy/llvmlite/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/36/wbzh7n_97jg1zk1ylzzfwqz80000gn/T/pip-record-pcj1wmd6/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Can you please help me to understand what is the problem here?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (10 by maintainers)

Commits related to this issue

Most upvoted comments

If the error appeared after April the 17th (see history) try installing it with

pip3 install llvmlite==0.31.0

If your goal is to use Numba, you will have to wait until our late-December release. Python 3.8 changed bytecode generation significantly enough to break the Numba frontend, and we are working on fixing it. The first patches have been merged to Numba’s master branch, but there are still pending Python 3.8 fixes.

If you use Python 3.7, you won’t have any build issues as we have posted binary wheels and conda packages for all platforms.

Just for information: the same error appears in Python 3.9. In 3.8 everything is fine.

@lakshinav thank you for adding to this issue. The Numba/llvmlite stack currently does not have a release to support Python 3.9. For llvmlite this means there is no binary wheel for Python 3.9 and an attempt to install llvmlite from PyPi will result in an attempted compilation of llvmlite which in turn yields the error you are observing.

There is an issue tracking this here: https://github.com/numba/numba/pull/6579 and we are hoping to release Python 3.9 support soon (where soon == couple of weeks).

@openedev you need to set the LLVM_CONFIG variable to the location of the llvm-config binary associated with the LLVM installation against which you are building. See point 2. of http://llvmlite.pydata.org/en/latest/admin-guide/install.html#compiling-llvmlite

any sample patch for missing llvm-config. I did have a similar issue 3.8

Bug:

got version from expanded keyword {‘version’: ‘0.32.0dev0’, ‘full’: ‘c969d89939b62156edaa26261faeb1c67ef40d77’} running build_ext /home/open/output/host/bin/python /home/open/output/build/python-llvmlite-0.32.0dev0/ffi/build.py LLVM version… Traceback (most recent call last): File “/home/open/output/build/python-llvmlite-0.32.0dev0/ffi/build.py”, line 105, in main_posix out = subprocess.check_output([llvm_config, ‘–version’]) File “/home/open/output/target/usr/lib/python3.8/subprocess.py”, line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File “/home/open/output/target/usr/lib/python3.8/subprocess.py”, line 489, in run with Popen(*popenargs, **kwargs) as process: File “/home/open/output/target/usr/lib/python3.8/subprocess.py”, line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File “/home/open/output/target/usr/lib/python3.8/subprocess.py”, line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: ‘llvm-config’

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “/home/open/output/build/python-llvmlite-0.32.0dev0/ffi/build.py”, line 168, in <module> main() File “/home/open/output/build/python-llvmlite-0.32.0dev0/ffi/build.py”, line 158, in main main_posix(‘linux’, ‘.so’) File “/home/open/output/build/python-llvmlite-0.32.0dev0/ffi/build.py”, line 107, in main_posix raise RuntimeError("%s failed executing, please point LLVM_CONFIG " RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config