interpret icon indicating copy to clipboard operation
interpret copied to clipboard

Python installation on python >=3.11 fails.

Open StrudelDoodleS opened this issue 1 year ago • 2 comments

Hi there,

I have found that i cant actually install interpret on python version 3.11 (.11)

Step to reproduce this are as such

mkdir testdir
cd testdir
uv init
uv venv --pythone 3.11
uv pip install interpret

This will yield teh following

Resolved 84 packages in 32ms
  × Failed to build `llvmlite==0.36.0`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)

      [stderr]
      Traceback (most recent call last):
        File "<string>", line 14, in <module>
        File
      "/home/max/.cache/uv/builds-v0/.tmpGhIOKB/lib/python3.11/site-packages/setuptools/build_meta.py",
      line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File
      "/home/max/.cache/uv/builds-v0/.tmpGhIOKB/lib/python3.11/site-packages/setuptools/build_meta.py",
      line 304, in _get_build_requires
          self.run_setup()
        File
      "/home/max/.cache/uv/builds-v0/.tmpGhIOKB/lib/python3.11/site-packages/setuptools/build_meta.py",
      line 522, in run_setup
          super().run_setup(setup_script=setup_script)
        File
      "/home/max/.cache/uv/builds-v0/.tmpGhIOKB/lib/python3.11/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.11.11; only versions >=3.6,<3.10 are supported.

      hint: This usually indicates a problem with the package or the build environment.
  help: `llvmlite` (v0.36.0) was included because `interpret` (v0.6.9) depends on `interpret-core[shap]`
        (v0.6.9) which depends on `shap` (v0.46.0) which depends on `numba` (v0.53.1) which depends
        on `llvmlite`

My way around this so far is:

uv pip install interpret --no-deps
uv pip install interpret-core 

Or

uv pip install interpret --no-deps
uv pip install interpret-core[debug,notebook,plotly,lime,sensitivity,linear,skoperules,treeinterpreter,aplr,dash,testing]

The above for just installing cool things like APLR and the like.

This seems to work though obviously shap will not work but perhaps updating it to 0.47.0 will resolve this? I can do submit a PR for this however i don't know what is causing setup.py in interpret-core to not grab the latest version of shap.

Let me know if I am totally missing something here.

Love the project as always. Best, Max

StrudelDoodleS avatar Mar 07 '25 17:03 StrudelDoodleS

Strange. Can you try running before installing:

python -m pip install --upgrade pip setuptools wheel

I didn't run into any issues when I tried using conda:

conda create --name interpret-pypi python=3.11
conda activate interpret-pypi
pip install interpret

paulbkoch avatar Mar 07 '25 22:03 paulbkoch

Strenge indeed your above methods work fine.

I am starting to think that this is a problem with uv at this point. I updated to the latest version of uv and for some strange reason with uv pip install interpret I get the same error where it pulls outdated version of llvmlite and shap (0.36.0 and 0.46.0 respectively). Not sure why, but it may be where uv is looking for packages.

Very odd behaviour.

I'll mark as closed

I found a similar thread here

StrudelDoodleS avatar Mar 08 '25 12:03 StrudelDoodleS