Help using custom GeoJson Files

Currently I’m working on an App to display stats in Mexico, everything is going fine but, i have an issue loading GeoJson files within Dash, my choroplethmapbox works fine in Jupyter and even when I usde fig.show(), inside a callback it works just fine.

Amy help on this issue will be greatly appreciated.

This is te result of runnig fig.show()in the callback

This is the same map in dash

Here’s a snippet of my code

app.layout = html.Div([
dcc.Slider(id='year-slider',
               min=2012,
               max=2020,
               marks={x: {'label': str(x)} for x in range(2012,2021)},
               value=2012,
            ),
            dcc.Graph(id="choropleth")
])

This is the callback I’m trying to implement

@app.callback(
    Output('choropleth', 'figure'),
    [Input('year-slider', 'value')])

def display_choropleth(selected_year):

#load polygons
    with open("states.json", encoding="utf8") as f:
        counties = json.load(f)

fig = go.Figure(px.choropleth_mapbox(dff, geojson=counties, featureidkey='properties.state_code',
                           locations='unique_values', color='counts',
                           color_continuous_scale="Viridis",
                           mapbox_style="carto-positron",
                           zoom=4.5, center = {"lat":23.634501 , "lon": -102.552784},
                           opacity=1,
                           labels={'counts':'Deceased'},
                           hover_name="unique_values"))
    accesstoken = token
    fig.update_layout(mapbox_style="dark", mapbox_accesstoken=accesstoken)
    fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0},height=700)
    fig.update_layout(coloraxis=dict(colorbar_thickness=30, colorbar_bgcolor='#1A1A1A',colorbar_tickfont_color='#fff',colorbar_title_font_color='#fff',colorbar_xanchor="right"))
    fig.show()
    return fig  

Please help.

Solved, it was a conflict among the libraries installed in my virtual env. Ill post the list of dependencies used if anyone else encounters this issue.

Flask-Assets==2.0
Jinja2==2.11.2
MarkupSafe==1.1.1
Werkzeug==1.0.1
brotli==1.0.9
click==7.1.2
cssmin==0.2.0
dash==1.16.3
dash-core-components==1.12.1
dash-html-components==1.1.1
dash-leaflet==0.1.4
dash-renderer==1.8.2
dash-table==4.10.1
flask==1.1.2
flask-compress==1.7.0
future==0.18.2
geobuf==1.1.1
gunicorn==20.0.4
itsdangerous==1.1.0
numpy==1.19.2
pandas==1.1.3
plotly==4.11.0
protobuf==3.13.0
python-dateutil==2.8.1
pytz==2020.1
retrying==1.3.3
six==1.15.0
webassets==2.0