I am unable to run any dash program. I get the error.
Dash was not successfully imported. Make sure you don't have a file named
'dash.py' in your current directory.
Also to check it out, I tried importing dash from python in terminal, surprisingly I can import dash in terminal where the directory don't contain .py file with dash import, whereas if any file contains import dash in it, I can't import dash in terminal in that directory. The attached picture will help you.
My problem was solved when i change the name of my file from test.py to test2.py, i hope it works for you.
I faced the same exact error message, and I made sure there wasn't any dash.py file in the folder.
However, there was a plotly.py file and renaming it solved the problem for me.
See this thread from the official Dash github repo. In my case, it was a file named test.py.
To share my experience, I created a file named copy.py in my working directory - I know it is not the best name - and I started getting this issue. I was confused since I didn't install any new packages. Also, all other files in that directory, which used to work, stopped working and gave the same error about dash.
Renaming that file, copy.py to something else solved it for me. I am not sure if there's a list of preserved file names which will create this issue.
Not sure if anyone will face it, basically I had it all working in Mac OS - Mojave, but after updating to Catalina "Dash was not successfully imported. Make sure you don't have a file named 'dash.py' in your current directory."
I can do import dash successfully at python prompt but strangely my program that worked fine in Mojave, threw above error.
I fixed it by
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With