Export Plotly Visuals as static

I am trying to create a plotly visual and then save it in a created images folder in my pycharm directory. I have used the same code used in the plotly website (Static image export in Python) however when i run the code, it gets stuck and the image does not get saved. can someone please help? I have kaleido installed as well.

import plotly.graph_objects as go
import numpy as np
import os
np.random.seed(1)

if not os.path.exists("images"):
    os.mkdir("images")

N = 100
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
sz = np.random.rand(N) * 30

fig = go.Figure()
fig.add_trace(go.Scatter(
    x=x,
    y=y,
    mode="markers",
    marker=go.scatter.Marker(
        size=sz,
        color=colors,
        opacity=0.6,
        colorscale="Viridis"
    )
))
fig.write_image("images/fig1.jpeg")

Hey @GabrielBKaram are you using Windows?

Apparently kaleido has some problems when using Windows as os:

Hey @AIMPED ,

I followed the link and I downloaded the same whl file for kaleidoscope. i then went on pycharm and wrote “pip install kaleido-0.1.0.post1-py2.py3-none-win_amd64.whl” however it is not finding the downloaded file. i even moved the downloaded whl file to the same directory. Do you know what i could be doing wrong?

Thanks !