Flask with Heroku, Import error: No module called Flask

So I am trying to create an application with Flask and Heroku. I can run it with Foreman just fine, but after deploying to Heroku, the application error appears and the heroku logs show:

heroku[web.1]: State changed from crashed to starting
heroku[web.1]: Starting process with command `python app.py`
app[web.1]:   File "app.py", line 2, in <module>
app[web.1]:     from flask import Flask, send_from_directory
app[web.1]: ImportError: No module named flask

      

Any idea how this might happen? Thank!

EDIT: Flask is in the requirements file and I can see that it gets installed on push to Heroku.

+3


source to share


1 answer


You probably need to add Flask (and any other external dependencies) to your requirements .txt file and include it in your repo.



You can use "pip freeze> requirements.txt" to build it using whatever packages you currently have installed in your environment.

0


source







All Articles