2

) 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? :-)

2
  • Maybe look at this stackoverflow.com/a/69142985/9098350, looks similar. Commented Oct 7, 2021 at 14:00
  • You may need to reinstall or upgrade dash pip install -U dash or if you are using environments to manage packages, double check you have dash installed in the environment you're using or that you have the correct environment activated. Commented Oct 8, 2021 at 12:57

2 Answers 2

16

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
Sign up to request clarification or add additional context in comments.

Comments

1

Same for import dash_html_components as html.

Use from dash import html

4 Comments

What do you mean by "same"? Same as what? You are aware that there is no predictable order of posts on StackOverflow, aren't you? It is individually configurable.
This should probably be edited into the previous answer so that both aspects of the question are answered in one post.
Sorry, not enough reputation to comment.
I combined the two responses. Good idea.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.