Getting error from beanstalk when trying to deploy flask app: "no module named flask" Getting error from beanstalk when trying to deploy flask app: "no module named flask" flask flask

Getting error from beanstalk when trying to deploy flask app: "no module named flask"


I encountered the exact same error. What helped for me is renaming the Flask object that you run to 'application':

from flask import Flaskapplication = Flask(__name__)# run the app.if __name__ == "__main__":    application.run()

From the Amazon EB Docs:

Using application.py as the filename and providing a callable application object (the Flask object, in this case) allows AWS Elastic Beanstalk to easily find your application's code.