[BUG] App doesn't work when ran from a different directory
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

Are you passing __name__ as the first argument to dash.Dash()?
Yea...
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).
Appreciate the information
On Thu, Apr 4, 2024 at 23:36 Sean @.***> wrote:
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).
— Reply to this email directly, view it on GitHub https://github.com/plotly/dash/issues/1889#issuecomment-2039049171, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARDMQUIYPHXE2ZGLZIU2LZ3Y3ZA5DAVCNFSM5L4MTTE2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBTHEYDIOJRG4YQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are most important to our community. If this issue is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. (Please note that we will give priority to reports that include a short reproducible example.) If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson