title: ModuleNotFoundError Cannot import from app.__init__.py
body: <p>I'm trying to setup a flask application which runs on Python 3.7.x. I've referenced many tutorials online but can't seem to resolve this ModuleNotFoundError and none of the stackoverflow questions are related.</p>
  <p>Below is my project structure:</p>
  <pre><code>project/
      app/
          __init__.py
          api.py
          conf.py
          models.py
          schema.py
      orders-mgmt.toml
      requirements.txt
      README.md
  </code></pre>
  <pre><code># app/__init__.py
  
  from flask import Flask
  from flask_restful import Api
  from app.conf import load_from_toml
  import logging
  import os.path
  
  if os.path.isfile('/opt/project/orders-mgmt.toml'):
      config = load_from_toml('/opt/project/orders-mgmt.toml')
  else:
      config = load_from_toml()
  
  app = Flask(__name__)
  api = Api(app)
  
  app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
  app.config['SQLALCHEMY_DATABASE_URI'] = config['mysql']['db_uri']
  app.config['SQLALCHEMY_ENGINE_OPTIONS'] = {
      'pool_recycle': 3000,
      'pool_pre_ping': True,
  }
  </code></pre>
  <pre><code># app/api.py
  
  from flask import jsonify
  from flask_restful import Resource
  from flask_sqlalchemy import SQLAlchemy
  from app import app, api, config #ERROR here
  from app.models import Request
  from app.schema import RequestSchema
  
  db = SQLAlchemy(app)
  
  
  class TestGet(Resource):
  
      def get(self):
          return 'okay'
  
  
  api.add_resource(TestGet, '/')
  
  if __name__ == '__main__':
      app.run(debug=True, host='localhost', port=5000)
  </code></pre>
  <p>I'm getting the <code>ModuleNotFoundError</code> in <code>app/api.py</code> line <code>from app import app, api, config</code> when I run <code>python app/api.py</code>:</p>
  <pre><code>$ python app/api.py
  Traceback (most recent call last):
    File &quot;app/api.py&quot;, line 4, in &lt;module&gt;
      from app import app, api, config
  ModuleNotFoundError: No module named 'app'
  </code></pre>
  <p>May I know what is the issue here with my flask application?</p>