Python Plotly/dash-模块';dash#u html#u组件';没有';分区';成员
我想从plotly运行此代码。Python Plotly/dash-模块';dash#u html#u组件';没有';分区';成员,python,plotly-dash,Python,Plotly Dash,我想从plotly运行此代码。 在此之前,我安装了以下模块: pip install dash==0.21.1 # The core dash backend pip install dash-renderer==0.13.0 # The dash front-end pip install dash-html-components==0.11.0 # HTML components pip install dash-core-components==0.23.0 # Superchar
在此之前,我安装了以下模块:
pip install dash==0.21.1 # The core dash backend
pip install dash-renderer==0.13.0 # The dash front-end
pip install dash-html-components==0.11.0 # HTML components
pip install dash-core-components==0.23.0 # Supercharged components
pip install plotly --upgrade # Latest Plotly graphing library
我的代码是:
import dash
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash()
app.layout = html.Div(children=[
html.H1(children='Hello Dash'),
html.Div(children='''
Dash: A web application framework for Python.
'''),
dcc.Graph(
id='example-graph',
figure={
'data': [
{'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'},
{'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': u'Montréal'},
],
'layout': {
'title': 'Dash Data Visualization'
}
}
)
])
if __name__ == '__main__':
app.run_server(debug=True)
但是它不起作用,我不明白为什么!
你能帮帮我吗!感谢使用python3可以执行代码 我的软件包版本是:
dash==0.21.1
dash-core-components==0.23.0
dash-html-components==0.11.0
dash-renderer==0.13.0
plotly==2.7.0
结果:
确实有效!我不知道我是否使用了适当的操作,但我为每个模块使用了pip3安装。再次感谢!