dash icon indicating copy to clipboard operation
dash copied to clipboard

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

Open Hunter2809 opened this issue 3 years ago • 4 comments

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

Hunter2809 avatar Jan 13 '22 17:01 Hunter2809

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

JonThom avatar Jan 14 '22 11:01 JonThom

Yea...

Hunter2809 avatar Jan 17 '22 04:01 Hunter2809

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).

seanslma avatar Apr 05 '24 06:04 seanslma

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: @.***>

rhigladney avatar Apr 05 '24 06:04 rhigladney

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

gvwilson avatar Jul 26 '24 12:07 gvwilson