[go: nahoru, domu]

Skip to content
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] App doesn't work when ran from a different directory #1889

Open
Hunter2809 opened this issue Jan 13, 2022 · 4 comments
Open

[BUG] App doesn't work when ran from a different directory #1889

Hunter2809 opened this issue Jan 13, 2022 · 4 comments

Comments

@Hunter2809
Copy link
Hunter2809 commented Jan 13, 2022

Describe your context

dash                          2.0.0
dash-core-components          2.0.0
dash-html-components          2.0.0
dash-table                    5.0.0
pydash                        5.0.0
  • if frontend related, tell us your Browser, Version and OS

    • OS: Windows
    • Browser [e.g. chrome, safari]
    • Version [e.g. 22]

Describe the bug
I have a files directory like this

root
 |
 |-- website
        |
        |-- main.py

So now, when I run the main.py from the root directory in VSCode (since I have opened the whole folder in VSCode), it stops running with the following output

Dash is running on http://127.0.0.1:8000/

 * Serving Flask app 'main' (lazy loading)
 * Environment: production
 * Debug mode: on
No module named main

I have never experienced this issue with either PyWebIO or Flask

Expected behavior
It should run the file normally without any error

Screenshots

image

@JonThom
Copy link
JonThom commented Jan 14, 2022

Are you passing __name__ as the first argument to dash.Dash()?

@Hunter2809
Copy link
Author

Yea...

@seanslma
Copy link
seanslma commented Apr 5, 2024

Weird. Seems we must run the main.py from outside of the module/package.
In this case, there is no issue if import the app in main.py and then run it as app.run(host='127.0.0.1', port=8000, debug=True).

@rhigladney
Copy link
rhigladney commented Apr 5, 2024 via email

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

4 participants