Dtreeviz and SHAP (summay_plot ) do not work in streamlit share


I have deployed web app (learning analytic web) in streamlit share as follows:

App URL:


User Name: demo01

Password: demo01

On the menu “Pass/Fail Prediction” in this app, decision tree graph and SHAP summary_plot do not work.

I think dtreeviz, graphviz and shap libraries may be successfully installed in the streamlit server.

This app is working on the Ubuntu server in my home. And, I did not find any difference of coding between these two.

Do you have any idea on this problem?

Coding is as follows:

fig = plt.figure(figsize = (5,5))
explainer = shap.TreeExplainer(load_clf,X)
shap_values = explainer.shap_values(X)

    st.subheader('Impact of explanatory variables (each item score) on\
         the objective variable (final score): Class 0 has an impact for Fail, Class 1 for Pass)')
    fig = shap.summary_plot(shap_values, X , plot_type = 'bar')

    from dtreeviz.trees import dtreeviz
    import graphviz as graphviz
    import streamlit.components.v1 as components

    viz = dtreeviz(
        target_name = 'Fail/Pass',
        feature_names = X_train.columns,
        class_names = ['Fail','Pass'],

    def st_dtree(plot, height = None):
        dtree_html = f'<body>{viz.svg()}</body>'
        components.html(dtree_html, height = height)

    st_dtree(dtreeviz(model, X_train, y_train,
            target_name = 'Pass/Fail', feature_names = X_train.columns,
            class_names = ['Fail','Pass']),400)

Your advice on this would be appreciated.