-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[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
[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
Comments
I had the exact same issue with a file named "test.py" |
OK this one is very weird... it appears to come from the pickle module: # Jython has PyStringMap; it's a dict subclass with string keys
try:
from org.python.core import PyStringMap
except ImportError:
PyStringMap = None Which you can see if you raise an error inside That seems like a terribly hacky bit of code to have living in the Python core, but we'll have to live with that part. This becomes a problem when I don't see a problem with |
Exact same issue with test.py |
@meltbox360 can you try raising an exception at the top of |
|
Good call. I think test is a reserved module name in python see standard_library TOP_LEVEL_MODULES = ['builtins',
'copyreg',
'html',
'http',
'queue',
'reprlib',
'socketserver',
'test',
'tkinter',
'winreg',
'xmlrpc',
'_dummy_thread',
'_markupbase',
'_thread',
] Still have no idea why this works with 1.12.0 and before though. |
Thanks @meltbox360 that's perfect. Haha |
rename file test.py to something else for it was caused by my file name which i named "test.py". |
For folks googling, I believe this error also appears in the form |
Tested Version = In my case, there is no When I rename Basically, for me to get functional I needed to ensure the application cannot perform |
Could this be prevented by just making dash to check if there is any |
Same issue with my script named |
* Use authenticated Docker pulls (#167) * Update CODEOWNERS * Bump dot-prop from 4.2.0 to 4.2.1 Bumps [dot-prop](https://github.com/sindresorhus/dot-prop) from 4.2.0 to 4.2.1. - [Release notes](https://github.com/sindresorhus/dot-prop/releases) - [Commits](sindresorhus/dot-prop@v4.2.0...v4.2.1) Signed-off-by: dependabot[bot] <[email protected]> * improve dash import test see plotly/dash#1143 * changelog for import bug fix * update extract-attributes script for latest MDN page structure and provide an error message if we see the page structure change in the future * description for setProps - to reduce warnings * use dash loosen-testing-reqs branch and fix linting * Fix spelling * back to dev branch of dash * bump ci images versions * Update config.yml * update component gen for MDN update Jan 2021 * error message if element count changes from expectation * add reference to MDN PR with the math & svg addition * bump to v1.1.2 (#176) * Remove context reference from CircleCI (#175) * fix ObjectEl data prop * add deprecation notes on some elements, and fix for a few more changes to MDN * update tests, and add tests for custom docs and ObjectEl * move percy to py37 and separate out finalize step * more test cleanup * one more try to combine percy snapshots * changelog for #178 * Add `allow` prop to html.Iframe * Add `referrerPolicy` prop and update tests * Add `referrerPolicy` prop and update tests * Updated changelog Fixes #77 * Update CHANGELOG.md * Bump elliptic from 6.5.3 to 6.5.4 Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](indutny/elliptic@v6.5.3...v6.5.4) Signed-off-by: dependabot[bot] <[email protected]> * update toolchain * Update CI images & py37 -> py39 * Bump y18n from 4.0.0 to 4.0.1 Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/yargs/y18n/releases) - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/yargs/y18n/commits) Signed-off-by: dependabot[bot] <[email protected]> * remove css * version bump 1.1.3 (#184) * version bump to 1.1.3 * update changelog * artifacts Co-authored-by: Ryan Patrick Kyle <[email protected]> Co-authored-by: Marc-André Rivet <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: alexcjohnson <[email protected]> Co-authored-by: Alex Johnson <[email protected]> Co-authored-by: John Bampton <[email protected]> Co-authored-by: Marc-André Rivet <[email protected]> Co-authored-by: Ann Marie Ward <[email protected]>
Describe your context
Describe the bug
If a file named
org.py
is present in the current directory with the following content:then dash doesn't import and I get the following message:
Expected behavior
dash should import without any error.
Additional info
Steps to replicate the problem on Linux
if I rename the file the import works:
The text was updated successfully, but these errors were encountered: