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

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
May 22, 2024

Hey!

I just forked your repository and tried deploying it on the App Platform and it worked out of the box without any changes:

Are you still seeing the issue on your end? If so, can you share the exact error that you get during the deploy process?

Also if you are still seeing the issue, can you confirm if you’ve changed your build and run commands? And if so can you share them here?

Best,

Bobby

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