PDF save function runs forever

I am using command such as:

fig.write_image(f"{path_result}/Leaderboard-Distribution.pdf")

and

import plotly.io as pio
pio.write_image(fig, f"{path_result}/Leaderboard-Distribution.pdf")

It runs forever if I did not set up the timeout…I have no idea how to make it work…

I am using plotly 6.1.2 and Python 3.12.9

Which OS are you using? @zhiminy