Error during SHAP library initialization: _internal failure without exception

21 views Asked by At

I am encountering an issue with the SHAP (SHapley Additive exPlanations) library in my Python environment. Specifically, during the initialization process of the SHAP library, I receive the following error message:

initialization of _internal failed without raising an exception

This error occurs in the context of importing a module within SHAP (shap.utils) and seems to be related to internal components or dependencies of the library.

I have created a machine learning model using Random Forest Classifier to determine whether a user will default on a loan or not. I encoded all the categorical columns and I want to see the Shapley Values of the model for a report.

I am running this on Visual Studio Code on Jupyter Notebook (ipynb) The bolded statements are part of the outputs that are perceived as errors

My env is as follows:

  • Python: 3.9.13
  • SHAP: 0.44.1
  • NumPy: 1.26.4

I also have seaborn and matplotlib for visualisation purposes.

import shap

Output:

~/opt/anaconda3/lib/python3.9/site-packages/shap/utils/__init__.py in <module>
----> 1 from ._clustering import (


----> 3 from numba.np.ufunc import _internal
      4 from numba.np.ufunc.parallel import ParallelUFuncBuilder, ParallelGUFuncBuilder
      5 

SystemError: initialization of _internal failed without raising an exception

Originally, it came up as numpy issue but after upgrading it, it came up as a initialisation issue

0

There are 0 answers