I have an error saving a Mapbox plot

Hi community,
I created a figure using Choroplethmapbox and Scattermapbox.

fig = go.Figure(go.Choroplethmapbox(geojson=counties, locations=df_county.FIPS, z=df_county[ā€˜Solar percā€™],
colorscale=ā€œAgsunsetā€, zmin=0, zmax=1,
marker_opacity=0.8, marker_line_width=0, marker_line_color=ā€˜whiteā€™))
fig.update_layout(mapbox_style=ā€œcarto-positronā€,
mapbox_zoom=3, mapbox_center = {ā€œlatā€: 37.0902, ā€œlonā€: -95.7129})
fig.add_trace( go.Scattermapbox(
lat=df_city[ā€˜Latitudeā€™],
lon=df_city[ā€˜Longitudeā€™],
mode=ā€˜markers+textā€™,
marker=go.scattermapbox.Marker(
size=4,
color=ā€˜blackā€™,
opacity=1
),
text=df_city[ā€˜Nameā€™],
hoverinfo=ā€˜textā€™))

Then, when I tried to save the figure using:
fig.write_image(ā€œfig1.pngā€)
I met this error:
ValueError: Transform failed with error code 525: Mapbox error.
Can anyone help me solve this problem?
Thanks a lot.

Hey I have the same issue!

Iā€™m making a figure with go.Scattermapbox() and I use something like this for the mapbox styling.

mapbox=dict(
                style='open-street-map',
                bearing=0,
                center=dict(
                    lon=case.network_n.geometry.x.mean(),
                    lat=case.network_n.geometry.y.mean()
                ),
                pitch=0,
                zoom=zoom,
            ),

Curiously I donā€™t get the error when I use fig.write_html(ā€˜test.htmlā€™). Here is the full error I get:

self.case.maps.isystem().write_image('test3.jpg')
Traceback (most recent call last):
  File "C:\Users\908367\.conda\envs\wm\lib\site-packages\IPython\core\interactiveshell.py", line 3437, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-13-31575a24df1a>", line 1, in <module>
    self.case.maps.isystem().write_image('test3.jpg')
  File "C:\Users\908367\.conda\envs\wm\lib\site-packages\plotly\basedatatypes.py", line 3806, in write_image
    return pio.write_image(self, *args, **kwargs)
  File "C:\Users\908367\.conda\envs\wm\lib\site-packages\plotly\io\_kaleido.py", line 245, in write_image
    img_data = to_image(
  File "C:\Users\908367\.conda\envs\wm\lib\site-packages\plotly\io\_kaleido.py", line 131, in to_image
    img_bytes = scope.transform(
  File "C:\Users\908367\.conda\envs\wm\lib\site-packages\kaleido\scopes\plotly.py", line 111, in transform
    raise ValueError(
ValueError: Transform failed with error code 525: Mapbox error.

I use plotly version 4.14.3, Kaleido version 0.1.0

Did you ever figure out what the problem was, or does anyone else know what this error really means? because I donā€™t have the slightest clue where to start with fixing this.