简体   繁体   中英

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

"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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM