You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[BUG] dash doesn't get imported when a file named "org.py", "dash.py", or "test.py" with specific content is present in the current directory // "AttributeError: module 'dash' has no attribute 'Dash'" #1143
If a file named org.py is present in the current directory with the following content:
import dash_core_components as dcc
then dash doesn't import and I get the following message:
>>> import dash
Dash was not successfully imported. Make sure you don't have a file named
'dash.py' in your current directory.
Expected behavior
dash should import without any error.
Additional info
The org.py is never imported
If I rename the file to a different name dash get imported without any problem.
The problem is shown also with ``import dash_html_components as html```
The problem is shown either on Windows and in Linux
Tested with python3.4, python3.6, python3.8
Steps to replicate the problem on Linux
$ mkdir mytest
$ cd mytest
$ echo "import dash_core_components as dcc" > org.py
$ python3 -m venv venv
$ . venv/bin/activate
(venv) $ pip install dash
(venv) $ python
Python 3.4.6 (default, Mar 01 2017, 16:52:22) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dash
Dash was not successfully imported. Make sure you don't have a file named
'dash.py' in your current directory.
(venv) $
if I rename the file the import works:
(venv) $ mv org.py othername.py
(venv) $ python
Python 3.4.6 (default, Mar 01 2017, 16:52:22) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dash
>>>