I have a strange issue. I am migrating to gunicorn. I managed to migrate one project. It runs well. But I failed to migrate the second project. I put the Hello World Dash app that just has one HTML tag. The same error. Then I took the project that I have already successfully migrated. Still the same error message. This suggests that this issue is not an issue with the code. It may be be the issue with the version of Dash, Plotly or other modules. I created a virtual folder where I have installed the latest versions of modules required to run the project. The issue persists.
Any idea what it may be?
Another indirect evidence that this is an issue with the module versions is that the error is with the ‘require’ keyword. The ‘require’ keyword is run on the server side only. Thanks for pointing at the solution. I spent already a week trying to figure out a solution. I also tried various things like sys.path.addsitedir, both True/False for app.scripts.config.serve_locally
if not, as a sanity check, I’d suggest trying the app in a fresh browser profile/private browsing mode, to check that it’s not some kind of weird caching issue.
No, I can use the external css. The issue was with the __ name __ present in the Dash class constructor. It worked now after removing __ name __ from the Dash class constructor. No idea why it created the issue.
But after removing the __ name __, the new issue appeared. The stylesheets in the assets folder aren’t served anymore. So I need to fix that __ name __ issue.
What fixed that person’s issue was to do a fresh install of everything.
It is possible that you are missing a key element. Or library. Make sure your requirements is up to date. If you are using something like pyodbc in Linux, you’ll need to add a couple of things to make it work as well.
Also, the main thing just keeps it from running twice since gunicorn actually runs your server from the server. At least I think so.
Yes, you are right. I may be missing something installed. Although I must say I reinstalled everything a few times and properly tested. But I found a solution. Imperfect but it works.