ModuleNotFoundError: No module named 'application'

Viewed 192

In attempting to deploy a Flask application to AWS Elastic Beanstalk, ModuleNotFoundError: No module named 'application' is thrown.

After reading several stackoverflow posts and sifting through AWS docs this same error is being produced, despite application working on local machine.

I'm using AWS EB w/ Linux 2 running Python 3.8.5.

My project tree:

-Crypto
 -App
  -folders
  -__init__.py
 -application.py
 -requirements.txt

Within the init.py file

  from flask import Flask
  from App.core.views import core


  application =  Flask(__name__)

  application.register_blueprint(core)

  application.config['SECRET_KEY'] = 'mysecret'

Within application.py

  from App import application

  if __name__ == '__main__':
      application.run(debug = True)

Many thanks in advance!

0 Answers
Related