"write_image" for exporting fig takes forever and does not create a static image in jupyter notebook

The version of kaleido you are using is unknown, but previous answers https://community.plotly.com/t/static-image-export-hangs-using-kaleido/61519 have suggested solutions for similar events. Please refer to them.