Error after long time using the app [AttributeError: <module 'numba.core.serialize']

Hi @malonsol :wave:

It took me a while come up with a fix. As I understand it, the error is triggered when you try loading your shap treeExplainer with joblib.

I think joblib uses numba to help with unpickling. Although you have pinned the joblib version, the version of numba (which is a joblib dependency) installed is the latest 0.54.1. This latest numba version does not contain the _rebuild_function function in its source code.

One of few versions that work is numba==0.51.0. If you pin this in your requirements file, the error disappears :partying_face:

Here’s the requirements file that worked in my fork:

numba==0.51.0
seaborn==0.11.0
xgboost==1.3.3
altair==4.1.0
matplotlib==3.3.2
streamlit==0.80.0
shap==0.39.0
missingno==0.4.2
category_encoders==2.2.2
pandas==1.1.3
numpy==1.20.2
joblib==0.17.0
scikit_learn==0.23.2

Hope this helps!

Happy Streamlit’ing, :balloon:
Snehan

2 Likes