Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Dash Tutorial, ImportError

Hello,
I’m having trouble running the app.py file from the tutorial at:
https://dash.plot.ly/getting-started

The 5 libraries installed fine using Anaconda Prompt as admin on Windows. Any idea what I’m missing? Thanks.

C:\Users<User>\Documents\Python\Dash\dash-master\dash>python app.py
Traceback (most recent call last):
File “app.py”, line 2, in
import dash
File “C:\Users<User>\Documents\Python\Dash\dash-master\dash\dash.py”, line 17, in
from .dependencies import Event, Input, Output, State
ImportError: attempted relative import with no known parent package

Do you happen to have a file or a folder named dash within the folder that you are working in?

A file named “dash.py” in the working folder was the culprit. I changed it to “old.py” and now it works. I also have folders named “Dash” & “dash” though that didn’t seem to matter. Thank you.

2 Likes