Eva
Eva

Reputation: 57

ImportError: cannot import name 'dcc' from partially initialized module 'dash' - python

I'm very new to python/dash/plotly and I keep getting the same error:

ImportError: cannot import name 'dcc' from partially initialized module 'dash' (most likely due to a circular import)

Does anyone know how to fix this? I've imported the following:

from dash import dcc
from dash import html
from dash.dependencies import Input, Output
import plotly.io as pio

Upvotes: 4

Views: 15702

Answers (1)

nrnw
nrnw

Reputation: 531

"most likely due to a circular import": this is probably due to your file being named as a dash or as a module name.

But I got the error message

ImportError: cannot import name 'dcc' from 'dash'

For me reinstalling dash fixed the issue.

  1. pip3 uninstall dash
  2. pip3 install dash

Upvotes: 11

Related Questions