Choropleth maps not showing but white page

  plotly, python

I’m trying to make a choropleth figure and below is my sample code:

import json
import numpy as np
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
import plotly.io as pio

pio.renderers.default='browser'
vietnam_state=json.load(open("diaphantinhenglish.geojson","r"))
df = pd.DataFrame({
    'Name': ['Ha Noi','Ha Giang','Cao Bang','Bac Kan','Tuyen Quang','20211012'],
    'Count': [3757,26,43,27,208,]})

#df
Name    Count
0   Ha Noi  3757
1   Ha Giang    26
2   Cao Bang    43
3   Bac Kan 27
4   Tuyen Quang 208

fig=px.choropleth(
    df,
    geojson=vietnam_state,
    featureidkey="properties.Name",
    locations="Name",
    color='Count',
    title="ABC",
    color_continuous_scale="Aggrnyl")

fig.update_geos(fitbounds="locations",visible=False)
fig.show()

It’s worked on my laptop with internet connection as below:
enter image description here

But on my PC without internet connection, maps doesn’t show and below is console:
enter image description here

So I would like to ask what should I do. Thanks and best regards.

Source: Python Questions

LEAVE A COMMENT