uv: Unable to install/build the `llvmlite` package
I ran into this while trying to install an internal package from a private repo that has a dep (or rather, dep of a dep, etc.) on llvmlite. I am able to successfully install the package when using pipx, but uv fails to install it.
❌ 2 ❯ uv tool install --python 3.11 --python-preference only-managed --extra-index-url 'my-url' --prerelease allow --refresh my-package
Resolved 26 packages in 808ms
error: Failed to prepare distributions
Caused by: Failed to fetch wheel: llvmlite==0.35.0
Caused by: Build backend failed to build wheel through `build_wheel()` with exit status: 1
--- stdout:
running bdist_wheel
/Users/taran/.cache/uv/builds-v0/.tmpsZC6qP/bin/python /Users/taran/.cache/uv/built-wheels-v3/index/6dbd262e64c3fb74/llvmlite/0.35.0/aQd_pIr8Ymw1uotL255dv/llvmlite-0.35
.0.tar.gz/ffi/build.py
LLVM version...
--- stderr:
Traceback (most recent call last):
File "/Users/taran/.cache/uv/built-wheels-v3/index/6dbd262e64c3fb74/llvmlite/0.35.0/aQd_pIr8Ymw1uotL255dv/llvmlite-0.35.0.tar.gz/ffi/build.py", line 105, in main_posi
x
out = subprocess.check_output([llvm_config, '--version'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/taran/.local/share/uv/python/cpython-3.11.9-macos-aarch64-none/lib/python3.11/subprocess.py", line 466, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/taran/.local/share/uv/python/cpython-3.11.9-macos-aarch64-none/lib/python3.11/subprocess.py", line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/taran/.local/share/uv/python/cpython-3.11.9-macos-aarch64-none/lib/python3.11/subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Users/taran/.local/share/uv/python/cpython-3.11.9-macos-aarch64-none/lib/python3.11/subprocess.py", line 1955, 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 "/Users/taran/.cache/uv/built-wheels-v3/index/6dbd262e64c3fb74/llvmlite/0.35.0/aQd_pIr8Ymw1uotL255dv/llvmlite-0.35.0.tar.gz/ffi/build.py", line 191, in <module>
main()
File "/Users/taran/.cache/uv/built-wheels-v3/index/6dbd262e64c3fb74/llvmlite/0.35.0/aQd_pIr8Ymw1uotL255dv/llvmlite-0.35.0.tar.gz/ffi/build.py", line 185, in main
main_posix('osx', '.dylib')
File "/Users/taran/.cache/uv/built-wheels-v3/index/6dbd262e64c3fb74/llvmlite/0.35.0/aQd_pIr8Ymw1uotL255dv/llvmlite-0.35.0.tar.gz/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 '/Users/taran/.cache/uv/builds-v0/.tmpsZC6qP/bin/python' failed with exit code 1
---
It seems like the issue occurs when trying to install the llvmlite package, which it tries to build (the error below is a little different than the initial error).
❌ 2 ❯ uv tool install --python 3.11 --python-preference only-managed --no-binary --refresh --prerelease allow --verbose llvmlite
DEBUG uv 0.3.0
DEBUG Searching for Python 3.11 in managed installations
DEBUG Searching for managed installations at `/Users/taran/.local/share/uv/python`
DEBUG Found managed installation `cpython-3.11.9-macos-aarch64-none`
DEBUG Found `cpython-3.11.9-macos-aarch64-none` at `/Users/taran/.local/share/uv/python/cpython-3.11.9-macos-aarch64-none/bin/python3` (managed installations)
DEBUG Using request timeout of 30s
DEBUG Using request timeout of 30s
DEBUG Acquired lock for `/Users/taran/.local/share/uv/tools`
DEBUG Using existing environment for tool `llvmlite`: /Users/taran/.local/share/uv/tools/llvmlite
DEBUG Found existing environment for `llvmlite`
DEBUG At least one requirement is not satisfied: llvmlite
DEBUG Using request timeout of 30s
DEBUG Solving with installed Python version: 3.11.9
DEBUG Adding direct dependency: llvmlite*
DEBUG Found stale response for: https://pypi.org/simple/llvmlite/
DEBUG Sending revalidation request for: https://pypi.org/simple/llvmlite/
DEBUG Found not-modified response for: https://pypi.org/simple/llvmlite/
DEBUG Searching for a compatible version of llvmlite (*)
DEBUG Selecting: llvmlite==0.43.0 [compatible] (llvmlite-0.43.0.tar.gz)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/23/ff/6ca7e98998b573b4bd6566f15c35e5c8bea829663a6df0c7aa55ab559da9/llvmlite-0.43.0-cp310-cp310-m
acosx_10_9_x86_64.whl.metadata
DEBUG Tried 1 versions: llvmlite 1
DEBUG Split specific environment resolution took 0.032s
Resolved 1 package in 33ms
DEBUG Must revalidate requirement: llvmlite
DEBUG Acquired lock for `/Users/taran/.cache/uv/built-wheels-v3/pypi/llvmlite/0.43.0`
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/9f/3d/f513755f285db51ab363a53e898b85562e950f79a2e6767a364530c2f645/llvmlite-0.43.0.tar.gz
DEBUG Building: llvmlite==0.43.0
INFO Ignoring empty directory
DEBUG Solving with installed Python version: 3.11.9
DEBUG Adding direct dependency: setuptools>=40.8.0
DEBUG Found stale response for: https://pypi.org/simple/setuptools/
DEBUG Sending revalidation request for: https://pypi.org/simple/setuptools/
DEBUG Found not-modified response for: https://pypi.org/simple/setuptools/
DEBUG Searching for a compatible version of setuptools (>=40.8.0)
DEBUG Selecting: setuptools==73.0.1 [compatible] (setuptools-73.0.1.tar.gz)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/07/6a/0270e295bf30c37567736b7fca10167640898214ff911273af37ddb95770/setuptools-73.0.1-py3-none-an
y.whl.metadata
DEBUG Tried 1 versions: setuptools 1
DEBUG Split specific environment resolution took 0.008s
DEBUG Installing in setuptools==73.0.1 in /Users/taran/.cache/uv/builds-v0/.tmp5621wb
DEBUG Must revalidate requirement: setuptools
DEBUG Downloading and building requirement for build: setuptools==73.0.1
DEBUG Acquired lock for `/Users/taran/.cache/uv/built-wheels-v3/pypi/setuptools/73.0.1`
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/8d/37/f4d4ce9bc15e61edba3179f9b0f763fc6d439474d28511b11f0d95bab7a2/setuptools-73.0.1.tar.gz
DEBUG Installing build requirement: setuptools==73.0.1
DEBUG Calling `setuptools.build_meta:__legacy__.get_requires_for_build_wheel()`
DEBUG Calling `setuptools.build_meta:__legacy__.build_wheel("/Users/taran/.cache/uv/built-wheels-v3/pypi/llvmlite/0.43.0/H_0AbqOoYKQrOJ2gTkAhX/.tmpmg60Nv", {}, None)`
error: Failed to prepare distributions
Caused by: Failed to fetch wheel: llvmlite==0.43.0
Caused by: Build backend failed to build wheel through `build_wheel()` with exit status: 1
--- stdout:
running bdist_wheel
/Users/taran/.cache/uv/builds-v0/.tmp5621wb/bin/python /Users/taran/.cache/uv/built-wheels-v3/pypi/llvmlite/0.43.0/H_0AbqOoYKQrOJ2gTkAhX/llvmlite-0.43.0.tar.gz/ffi/build.py
LLVM version...
--- stderr:
Traceback (most recent call last):
File "/Users/taran/.cache/uv/built-wheels-v3/pypi/llvmlite/0.43.0/H_0AbqOoYKQrOJ2gTkAhX/llvmlite-0.43.0.tar.gz/ffi/build.py", line 235, in <module>
main()
File "/Users/taran/.cache/uv/built-wheels-v3/pypi/llvmlite/0.43.0/H_0AbqOoYKQrOJ2gTkAhX/llvmlite-0.43.0.tar.gz/ffi/build.py", line 229, in main
main_posix('osx', '.dylib')
File "/Users/taran/.cache/uv/built-wheels-v3/pypi/llvmlite/0.43.0/H_0AbqOoYKQrOJ2gTkAhX/llvmlite-0.43.0.tar.gz/ffi/build.py", line 142, 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 '/Users/taran/.cache/uv/builds-v0/.tmp5621wb/bin/python' failed with exit code 1
---
Platform: macOS 14.6 (23G80)
uv version: uv 0.3.0 (dd1934c9c 2024-08-20)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 32 (12 by maintainers)
Commits related to this issue
- build(uv): add constraint on numba to avoid resolution error Otherwise it backtracks to an old numba and then llvmlite version that can't be built: https://github.com/astral-sh/uv/issues/6281 — committed to idiap/coqui-ai-TTS by eginhard 2 years ago
- build(uv): add constraint on numba to avoid resolution error Otherwise it backtracks to an old numba and then llvmlite version that can't be built: https://github.com/astral-sh/uv/issues/6281 — committed to idiap/coqui-ai-TTS by eginhard 2 years ago
- build(uv): add constraint on numba to avoid resolution error Otherwise it backtracks to an old numba and then llvmlite version that can't be built: https://github.com/astral-sh/uv/issues/6281 — committed to idiap/coqui-ai-TTS by eginhard 2 years ago
- build(uv): add constraint on numba to avoid resolution error Otherwise it backtracks to an old numba and then llvmlite version that can't be built: https://github.com/astral-sh/uv/issues/6281 — committed to idiap/coqui-ai-TTS by eginhard 2 years ago
I have a similar problem to you @joennlae with the llvm version. I would prefer not installing this old llvm version and it would be impossible to get my whole student team to do it 😅 The llvmlite docs say to use binary wheels to install it: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html# How does one specify this to uv?
edit: I believe
uv add --no-build-package llvmlite llvmliteworkedThanks! It’s roughly what I was describing above… With that set of dependencies, we end up solving for
numpy==2.1.0, whilepipends up withnumpy==2.0.1. If you trace the log closely, you’ll see that we picknumpy==2.1.0, then try variousnumbaversions until we hitnumba==0.52.0rc2, which depends onnumpy>=1.15. (All the laternumbaversions have an upper-bound on NumPy). Once we pick that, we have to pick anllvmliteversion that meetsllvmlite>=0.35.0.dev0, <0.36.In the absence of more constraints from the user, both resolutions are valid. We can’t really “know” that you would prefer a more recent
llvmliteandnumba, but a less recentnumpy, unless you give us more information.I might suggest adding
numpy>=2, <2.1to your requirements? Or adding that as a constraint file.👍 @derek-pyne you can also use
to add a constraint without adding it as a dependency of your project.
I am not sure if this is an
uvissue. I have this issue with v2.3.7 and v3.0.I was able to fix it by pinning the numba version to
numba>=0.60.0I ran into this issue when trying to install
llvmliteon Python 3.13 and the solution was to downgrade to Python 3.12. Potentially related issue https://github.com/numba/llvmlite/issues/1084@taranlu-houzz – You can pass the file like
uv tool install --with-requirements constraints.txt <tool>.My story:
So my python version is
3.11. I fixednumpy<2.0. Only thenumbaversion abovenumba>=0.57can be installed inpython 3.11(https://github.com/numba/numba/blob/288a38bbd5a15418a211bf067878dfdf3c139509/setup.py#L23) except fornumba==0.51(which did not set an upper limit yet).Numbafor me is installed because oflibrosathere they fixnumba>=0.51(https://github.com/librosa/librosa/blob/b2cd8fb803345685152a2b41e752ad09f33d261b/setup.cfg#L93)So it jumped down to
numba=0.51. I can not reproduce it anymore. So, for me, it is fixed now.Had this same behaviour where
uvwas trying to install an old version ofllvmlitewhich was a dependency of one of my dependencies (in my case: umap-learn). This dependency doesn’t need the old version of llvmlite.These dependencies were resolvable with poetry (I’m migrating).
Tried to recreate with a smaller project without success
Solution was to explicitly add
llvmliteas a dependency (ie.uv add llvmlite). This makes sure that it uses a recent version ofllvmlite(>=0.43.0)