Updating from 4.1 with dash_labs plugin to 5.1 without dash_labs plugin, the pages of my app disappeared.
I commented import dash_labs as dl and plugins=[dl.plugins.pages], in
Hmm, it could possibly be the same issue I ran into on Windows. Long story short, Windows handles paths slightly different than Unix based systems, like Ubuntu and MacOS. The pages feature was not accounting for this difference.
I’m not super familiar with the Windows Linux subsystem and how the paths work, but this could be the case.
A fix is coming soon for the paths problem, but I’m not 100% sure if this will fix your issue or not.
My app works fine with dash-labs plugin and dash 4.1, so the issue preventing my app to work with dash 5.x should have been introduced while moving dash-labs code to dash 5.x.
Is it possible to have a look at the issue/fix you are talking about?
Hi @nopria - The issue that @raptorbrad was referring to was fixed in dash 2.5.1.
Here are the steps to go from the dash-labs plug-in to dash. It looks like you might have missed step 2. Can you let me know if this works for you?
Convert your multi-page app from a dash-labs pages plug-in to the pages feature in dash 2.5.1 in 3 easy steps:
Remove import dash_labs as dl or upgrade dash-labs to V1.1.0
There is a conflict between dash-labs versions less than 1.1.0 when running a pages app in dash 2.5.1
Change:
app = Dash(__name__, plugins=[dl.plugins.pages])
to:
app = Dash(__name__, use_pages=True)
Change:
dl.plugins.page_container
to:
dash.page_container
That’s it!
Thepages feature will no longer be developed in dash-labs. I recommend all dash-labs multi-page apps be converted to use the pages feature in dash>= 2.5.1
Hello all,
can someone please help me with this error.
I am stuck with a error in build exe file of my multipage dash app. I am using cx_Freeze library to build my exe file.
After successfully building exe file, and run the my app.exe:
windows console display an error that pages folder does not exist as a result, I am unable to navigate through my different pages of my app.
I tried with (dash version2.31+dash labs 1.06) and (dash version 2.5.1+1.10) both yield me same error.
Note: The dash plugins for pages works perfectly fine when I run my code in Vscode.
I haven’t tried making an exe file from a pages app, but here is how you can make it so dash does not look for the pages folder. Basically, you do this by registering each page in app.py instead of from within the pages folder.
Note - this will only work ind dash>=2.5.1
Assuming you have a project structure that looks like this:
- app.py
- pages
|-page1
|-page2
Remove dash.register_page(__name__) from pages.page1 and pages.page2
Then in app.py, import each page:
from pages import page1, page2
Register the page in app.py. You will have to assign the layout and give each a unique module name rather than using __name__ ,
Thanks for quick response.
I am able to register pages on code level and check with print(dash.register_pages.values()) statement but the Layout is not displaying
just curious, In step 3:
@Harsha_Dreamer - it can’t be a string like this: ‘layout=page1.layout’. It looks like you skipped step 2 with importing the modules from the pages folder.
Thanks for repo link. There were minor changes required to build exe.
I was able to build exe and run it successfully. The exe is functioning correctly for all pages except in one page where I am running Machine Learning .
In ML page, I have used process ProcessPoolExecutor() module to do carry out repeated tasks parallel. In my Vscode the ProcessPoolExecutor() is running fine. But as, I run exe file, the exe just keeps loading ML page doesn’t give any output. Is it possible to throw some light on this error?
Can you help with any documentation on how to connect dash app to SQL DB for live updates?
@AnnMarieW
Hi, I’m having trouble running any multi-paged app. I’ve tried creating a new venvironment and installing the new Dash version from the start but it keeps failing.
This is what appears in the web browser after running the app. There’s no problem when running single page apps.
pip install dash==2.5.1 seemed to fix it for me, or if you try refreshing the page this also works. As Dash 2.6.0 just dropped last week, this bug might not be reported?
Hey @AnnMarieW
Do you have a published example of a Dash app that has a URL string at the end where specific parameter is provided to parameterize the Dash app itself when it starts up?
Asking for a friend, and not sure where to best search …