Exception problem deploying streamlit app with PM4PY graph

Currently i’m working to create a streamlit app to quickly process event logs and give insights about the process. I’m using python, with .pm4py process mining package and after some local testing I am deploying it to streamlit sharing. Everything was working fine on local testing but now i’m getting the following error with Heuristics net graph

File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/scriptrunner/script_runner.py", line 557, in _run_script
    exec(code, module.__dict__)
File "app.py", line 142, in <module>
    pm.save_vis_heuristics_net(heu_net, "heu_net.png")
File "/home/appuser/venv/lib/python3.9/site-packages/pm4py/vis.py", line 325, in save_vis_heuristics_net
    gviz = hn_visualizer.apply(heu_net, parameters={parameters.FORMAT: format, "bgcolor": bgcolor})
File "/home/appuser/venv/lib/python3.9/site-packages/pm4py/visualization/heuristics_net/visualizer.py", line 55, in apply
    return exec_utils.get_variant(variant).apply(heu_net, parameters=parameters)
File "/home/appuser/venv/lib/python3.9/site-packages/pm4py/visualization/heuristics_net/variants/pydotplus_vis.py", line 305, in apply
    graph.write(file_name.name, format=image_format)
File "/home/appuser/venv/lib/python3.9/site-packages/pydotplus/graphviz.py", line 1918, in write
    fobj.write(self.create(prog, format))
File "/home/appuser/venv/lib/python3.9/site-packages/pydotplus/graphviz.py", line 1959, in create
    raise InvocationException(

This is my code (filtered log is already defined):

filtered_log = pm.filter_case_size(elog, 3, 30)
        heu_net = pm.discover_heuristics_net(filtered_log, dependency_threshold=0.99, loop_two_threshold=0.99)
        pm.save_vis_heuristics_net(heu_net, "heu_net.png")
        st.image("heu_net.png")

Thank you in advance!