Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 527
Eva Avatar asked Oct 18 '25 06:10

Eva


1 Answers

"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
like image 104
Niyu Avatar answered Oct 20 '25 19:10

Niyu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!