Denny
Denny

Reputation: 57

(Python) dash core components - ModuleNotFound

) When I want to import dash_core_components

import dash_core_components as dcc

it throws the following error:

File "d:\Desktop\python_projekte\ds2.py", line 1, in <module>
    import dash_core_components as dcc
  File "C:\Python39\lib\site-packages\dash_core_components\__init__.py", line 1, in <module>
    from dash.dcc import *  # noqa: F401, F403, E402
ModuleNotFoundError: No module named 'dash.dcc'

But I acually installed dash_core_components and I also tried updating it, but I still receive this error. I've got also a similar error with dash_html_components.

I really don't know what to do. Does someone have an advice? :-)

Upvotes: 2

Views: 6621

Answers (2)

tnwei
tnwei

Reputation: 962

For people coming across this issue in 2022, the syntax of:

import dash_core_components as dcc
import dash_html_components as html

has been deprecated. Use this syntax instead:

from dash import dcc
from dash import html

Upvotes: 16

Gabriel Torcat
Gabriel Torcat

Reputation: 36

Same for import dash_html_components as html.

Use from dash import html

Upvotes: 1

Related Questions