Question

Flask app builds but deployment fails, possibly due to matplotlib or dependency management?

I am building and deploying this [1] [2] Flask app with App Platform. It incorporates two git submodules, each of them a python plotly/dash dashboard project. Build and deployment would work fine as long as I use native plotly plots. But a newer commit that additionally uses matplotlib included into the dashboard as per this [3] tutorial, fails, not during build, but during deployment. Locally on my own machine, it all works. What could be the cause?

If dependency management is a common issue: I am using normal pip + venv for the main app and one of the dashboards. The one with the matplotlib additions uses poetry when running standalone (both dashboards are designed to be able to run standalone). When being run by the main Flask app, it is this main app that provides the dependencies. (In other words, its requirements.txt contains more dependencies than strictly necessary for itself to run, but it also provides for its child apps.)

Any help is much appreciated.

Cheers

[1] https://github.com/andmbg/portfolio

[2] https://starfish-app-559vv.ondigitalocean.app/

[3] https://plotly.com/blog/dash-matplotlib


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel