Flask App deployment fails

Hello, I have been trying to deploy a Flask App on render, but its failing. It is able to build from the git repo, but while deployment, it fails with this error:

No module named ‘your_application’

The same set of files works perfectly fine on Heroku.

Thanks,
Kushal.

Hi Kushal,

Thanks for reaching out.

You’ll need to double-check you’re installing all your dependencies in the Build Command, e.g. with pip.

If you are, the next thing to check would be the Start Command, is that the same as you had in your starting your web dyno on Heroku (the command in theProcfile after web:)?

Kind regards

Alan

I have added a requirements file containing the dependencies. Do I need to add the pip command in Procfile or elsewhere? It was not required on Heroku. I have uploaded the same folder to render, but its not working.

Render doesn’t use Procfiles.

Your original error No module named ‘your_application' implies that you haven’t set the Start Command correctly, and are just using the placeholder defaults when creating a Python Web Service:


The Start Command needs to be the command that starts your own app. As you said it works on Heroku, I assume the command in the Procfile after web: would be the command you need to set as the Start Command (on the settings page of your service).

Alan

Thanks for the clarification! Adding it on the settings page resolved the issue. :slight_smile:
The page is now up on bekushal.onrender.com

Great, very glad to hear you’re up and running.

Thanks for using Render!

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.