有人知道为什么“ dash-html-components”不起作用吗?
我正在使用Python 3.8.2运行Ubuntu LTS 20.04
我已经使用'pip3 install'安装了所有软件包。
我正在尝试运行以下代码:
import dash
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash() #creates flask application
colors = {'background':'#111111','text':'#7FDBFF'}
app.layout = html.Div(children = [
html.H1('Hello Dash!',style={'textAlign':'center',
'color':colors['text']}),
#html.Div('Dash: Web Dashboards with Python'),
dcc.Graph(id = 'example',
figure={'data':[
{'x':[1,2,3],'y':[4,2,1],'type':'bar','name':'SF'},
{'x':[1,2,3],'y':[2,4,5],'type':'bar','name':'NYC'}
],
'layout':{
'plot_bgcolor':colors['background'],
'paper_bgcolor':colors['background'],
'font':{'color':colors['text']},
'title':'BAR PLOTS!'
}})
], style = {'backgroundColor':colors['background']}
)
if __name__ == '__main__':
app.run_server()