3

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
sj95126
  • 6,520
  • 2
  • 15
  • 34
Eva
  • 47
  • 1
  • 1
  • 5
  • 2
    is the name of your file dash.py? don't name any of your files after the same names as modules, it can confuse the module importer; that may be one culprit – John Collins Nov 07 '21 at 22:39
  • always put full error message (starting at word "Traceback") in question (not comment) as text (not screenshot, not link to external portal). There are other useful information. – furas Nov 08 '21 at 00:07

1 Answers1

10

"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
nrnw
  • 441
  • 6
  • 13