Python 如何让Dash使用Choropleth绘图仪

Python 如何让Dash使用Choropleth绘图仪,python,plotly,plotly-dash,Python,Plotly,Plotly Dash,我正在尝试使用Dash来显示一个有情节的choropleth地图。我尝试过在anaconda提示符中使用conda update--all和conda update Dash来更新Dash和Plotly,但这并没有解决问题。下面是代码为fig.show()代码和破折号代码生成的图像链接 无法工作的短划线绘图仪: 代码如下: external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] app = dash.Das

我正在尝试使用Dash来显示一个有情节的choropleth地图。我尝试过在anaconda提示符中使用
conda update--all
conda update Dash
来更新Dash和Plotly,但这并没有解决问题。下面是代码为
fig.show()
代码和破折号代码生成的图像链接

无法工作的短划线绘图仪:

代码如下:

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)


fig = px.choropleth(dt_rwly_stn, geojson=smh, color="ConfirmedCovidCases",
                    locations="CountyName", featureidkey="properties.CountyName",
                    projection="mercator",
                    color_continuous_scale= 'Reds',
                   )
fig.update_geos(fitbounds="locations", visible=False)
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.show() 

app.layout = html.Div(children=[
    html.H1(children='My First Dash'),

    html.Div(children='''
        Dash: A web application framework for Python.
    '''),

    dcc.Graph(
        id='example-graph1',
        figure=fig
    ),
])
                 
    
if __name__ == '__main__':
    app.run_server(debug=True, use_reloader=False)

有人能帮我用Dash正确显示绘图图形吗?

我解决了这个问题。我不得不卸载Anaconda,因为我的基本环境中安装了太多相互冲突的软件包。当我重新安装它时,我创建了一个新的环境,只安装了我需要的软件包(即
conda install-c conda forge dash
conda install-c conda forge plotly