2
votes
  • Environment

OS: Windows 10
Python 3.8.2

The installed Dash components are: (pip list | grep dash):
dash 1.16.2
dash-core-components 1.12.1
dash-html-components 1.1.1
dash-renderer 1.8.2
dash-table 4.10.1
jupyter-dashboards 0.7.0

  • Used Python code
import dash_core_components as dcc
import plotly.express as px

df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length")

dcc.Graph(figure=fig)
  • Given result

Python script aborted with en error message in the console:

AttributeError: module 'dash_core_components' has no attribute 'Graph'

Screenshot of expected result

1
Have you tried pip uninstalling and then reinstalling? Maybe the initial installation was corrupted somehow. - coralvanda
MY idea: It is probably due to some configuration of the involved modules. I downgraded dash and dcc (dash 1.16.0, dash-core-components 1.12.0. However, that did not help (the error remained). I will still uninstall all dash modules and reinstall freshly starting with dash. Are there any configuration files in dash/dcc where tolook for the components? - squeezer44

1 Answers

0
votes

It's now fixed and works as expected.

After I uninstalled all dash components and reinstalled them in this order:

  1. dash-core-components
  2. dash (tooks all dependencies)
    and rerun the script it works fine.
  • My configuration at the end
    dash 1.16.2
    dash-core-components 1.12.1
    dash-html-components 1.1.1
    dash-renderer 1.8.2
    dash-table 4.10.1