Search code examples
pythonweb-applicationsplotly-dash

Plotly Dash app working in Windows 10 but not Windows 11


I have a problem with my Python (v3.8.16) Dash App - it runs fine in Windows 10. In Windows 11, however, there are 2 issues.

Context:

My app automates analysis of uploaded .txt files and displays a mixture of plots as png images, interactive Plotly plots and Pandas styled tables. Additionally, some of my data runs into millions of rows and I therefore also convert some plots from the standard html to pngs on the back-end. These pngs are then served to the front-end for display.

The app also writes all plots and tables to file as part of the pipeline.

These are the 2 problems:

1 - Interactive plots are written to file and standalone launch and display in Firefox (v112.0). However, in the app tabs that display these plots nothing appears and I get the following error after a few minutes:

Loading chunk 196 failed - stack trace is extensive but seems to relate to Javascript backend. Happy to add in follow-up post if necessary.

2 - Plots that are converted to pngs on the backend seem to hang during conversion. This same data in Windows 10 takes a 6-7 minutes to convert and display the data in the app. As far as I can tell, all the Python processes that generate tables prior to plot generation completes.

Note: I have a tab that updates with completion messages as each section completes. The interactive plots give completion message, but the static png sections all hang as notred above.

Interestingly, my Pandas styled tables display ok. These are also html, which I then pass into a html.Iframe() object that can be passed directly to the app layout.

These are my dependencies:

pandas==1.3.1
numpy==1.20.1
scikit-learn==0.22.1
scipy==1.4.1
plotly==5.0.0
dash==2.6.1
dash-core-components==2.0.0
dash-html-components==2.0.0
dash-extensions==0.0.58
dash-uploader==0.5.0
flask==2.1.0
kaleido==0.2.1

What I tried:

Updated Dash, Plotly and Flask packages to latest versions. Does not change behaviour previously noted.

As far I can tell, Windows 11 is the only difference.

Have any of you had similar issues?

Many thanks for your time and consideration.


Solution

  • I finally found a solution. See this post - https://github.com/plotly/Kaleido/issues/126

    Downgrading Kaleido version as stated in post did the trick.

    For my purposes, the older Kaleido version doesn't appear to cause other issues.