How to view png images from pm4py Process Mining

How to view images generated from the pm4py package

import pm4py
import os

log = pm4py.read_xes(os.path.join("tests", "input_data", "receipt.xes"))
pm4py.view_events_distribution_graph(log, distr_type="days_week", format="svg")

using

st.write(pm4py.view_events_distribution_graph(log, distr_type="days_week", format="svg"))

returning None

You should save the export to an image and then use st.image:

from pm4py.algo.discovery.dfg import algorithm as dfg_discovery
log = xes_importer.apply('receipt.xes')
dfg = dfg_discovery.apply(log)
gviz = dfg_visualization.apply(dfg, log=log, variant=dfg_visualization.Variants.FREQUENCY)

from PIL import Image
image = Image.open(dfg_visualization.view(gviz))
st.image(image, caption='Frequency chart')

I have an issue with deployment in streamlit community cloud using pm4py. The error is “graphviz.backend.execute.ExecutableNotFound: failed to execute PosixPath(‘dot’), make sure the Graphviz executable are on your systems’ PATH”
On my localhost the images generated work just fine. But I get that error when the app is deployed. Have you ran into this issue before while deploying, if so, possible solutions?