Skip to content

[BUG] dash will not import if test.py present in current dir. #1387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pete312 opened this issue Aug 31, 2020 · 1 comment
Closed

[BUG] dash will not import if test.py present in current dir. #1387

pete312 opened this issue Aug 31, 2020 · 1 comment

Comments

@pete312
Copy link

pete312 commented Aug 31, 2020

This took a while for me to understand what was happening. If you have a file called test.py with import dash_html_components in it, dash will not import. Its often that you have a test.py script in your dir to test out dash but you would not expect that to interfere with an import of another dash program.

To recreate:


$ mkdir /tmp/dashtest
$ cd /tmp/dashtest
$ python3.6 --venv ve
$ ./ve/bin/pip install dash

Successfully installed Flask-1.1.2 Jinja2-2.11.2 MarkupSafe-1.1.1 Werkzeug-1.0.1 brotli-1.0.9 click-7.1.2 dash-1.15.0 dash-core-components-1.11.0 dash-html-components-1.1.0 dash-renderer-1.7.0 dash-table-4.10.0 flask-compress-1.5.0 future-0.18.2 itsdangerous-1.1.0 plotly-4.9.0 retrying-1.3.3 six-1.15.0


$ echo "import dash_html_components" > test.py
$ ./ve/bin/python -c "import dash" ; echo $?
Dash was not successfully imported. Make sure you don't have a file named
'dash.py' in your current directory.
1

$ mv test.py out.py
$ ./ve/bin/python -c "import dash" ; echo $?
0

@alexcjohnson
Copy link
Collaborator

duplicate of #1143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants