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

Installation fails for statsforecast due to llvmlite Python version constraint #9413

Closed
asdf8601 opened this issue Nov 25, 2024 · 3 comments
Closed

Comments

@asdf8601
Copy link

Description

When trying to install statsforecast using uv, the installation fails due to
a Python version constraint in llvmlite==0.36.0.

  RuntimeError: Cannot install on Python version 3.10.15; only versions >=3.6,<3.10
  are supported.

Environment

  • Python version: 3.10.15
  • uv version: 0.5.4 (c62c83c 2024-11-20)
  • Operating System: macOS

Steps to Reproduce

  1. Create a new virtual environment with uv
  2. Install numpy and statsforecast
    • uv pip install numpy statsforecast
    • uv add numpy statsforecast

Workarounds

Adding dependencies one by one:

# In this order, the opposite results in the same error.
uv add statsforecast
uv add numpy

Using python-venv and pip works fine:

$ python -m venv .venv-pip

$ ./.venv-pip/bin/pip install numpy statsforecast -q -I

[notice] A new release of pip is available: 23.0.1 -> 24.3.1
[notice] To update, run: python -m pip install --upgrade pip

Log

$ python -V
Python 3.10.15

$ uv version
uv 0.5.4 (c62c83c37 2024-11-20)

Installing numpy and statsforecast

$ uv python pin 3.10

$ uv venv

$ . .venv/bin/activate

$ uv pip install numpy statsforecast
Resolved 14 packages in 17ms
  × Failed to download and build `llvmlite==0.36.0`
  ╰─▶ Build backend failed to determine requirements with `build_wheel()` (exit status: 1)

      [stderr]
      Traceback (most recent call last):
        File "<string>", line 14, in <module>
        File
      "/Users/asdf8601/.cache/uv/builds-v0/.tmppKvNui/lib/python3.10/site-packages/setuptools/
build_meta.py",
      line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File
      "/Users/asdf8601/.cache/uv/builds-v0/.tmppKvNui/lib/python3.10/site-packages/setuptools/
build_meta.py",
      line 304, in _get_build_requires
          self.run_setup()
        File
      "/Users/asdf8601/.cache/uv/builds-v0/.tmppKvNui/lib/python3.10/site-packages/setuptools/
build_meta.py",
      line 522, in run_setup
          super().run_setup(setup_script=setup_script)
        File
      "/Users/asdf8601/.cache/uv/builds-v0/.tmppKvNui/lib/python3.10/site-packages/setuptools/
build_meta.py",
      line 320, in run_setup
          exec(code, locals())
        File "<string>", line 55, in <module>
        File "<string>", line 52, in _guard_py_ver
      RuntimeError: Cannot install on Python version 3.10.15; only versions >=3.6,<3.10
      are supported.

  help: `llvmlite` (v0.36.0) was included because `statsforecast` (v0.7.1) depends on
        `numba` (v0.53.1) which depends on `llvmlite`
@charliermarsh
Copy link
Member

Thanks for the write-up. This is a case of #8157 and is explained in there. We'll improve it soon.

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
@asdf8601
Copy link
Author

Nice, thank you! I've opened this issue for two main reasons: the first one is that I wasn't 100% sure that #8157 was the same issue, and second, to provide an alternative for other devs as #8157 didn't help me in that way :-)

@lmmx
Copy link

lmmx commented Dec 22, 2024

Just to clarify for anyone else landing on this, in case the workaround is unclear; a working solution is to just pip install then grep pip list for the offending package's version + then pin that (in this case llvmlite==0.43.0).

  • Problem: cannot uv run --with jupyter jupyter lab because llvmlite gets set to 0.36.0
  × Failed to build `llvmlite==0.36.0`                                                                                                                                               
  • Cheat: run pip install llvmlitein your venv, thenpip list | grep llvmlite` which shows the version 0.43.0 gets installed
  • Solution: run uv add llvmlite>=0.43.0 to your project, then either uv add jupyter or uv run --with jupyter jupyter lab work

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