title: Flask ImportError: cannot import name ''
body: <p>This is my application tree, since this application is relatively big, I am using blueprints divisional structure to structure it.</p>
  
  <pre><code>RPOSS
  ├───.idea
  ├───app
  │   ├───customer_panel
  │   │   ├───static
  │   │   ├───templates
  │   │   └───__pycache__
  │   ├───owner_panel
  │   │   ├───static
  │   │   │   └───js
  │   │   │       └───lib
  │   │   ├───templates
  │   │   └───__pycache__
  │   ├───progressive_panel
  │   │   ├───static
  │   │   ├───templates
  │   │   └───__pycache__
  │   ├───static
  │   ├───templates
  │   └───__pycache__
  ├───Include
  ├───instance
  │   └───__pycache__
  ├───Lib
  ├───Scripts
  └───__pycache__
  </code></pre>
  
  <p><code>RPOSS/app/run.py</code>:</p>
  
  <pre><code>from app import app
  app.run()
  </code></pre>
  
  <p><code>RPOSS/app/__init__.py</code>:</p>
  
  <pre><code>from app.views import Rmod
  from app.customer_panel.views import Cmod
  from app.owner_panel.views import Omod
  from app.progressive_panel.views import Smod
  from instance.config import engine
  from sqlalchemy.orm import sessionmaker
  
  
  app = Flask(__name__,
          static_folder='./static',
          instance_relative_config=True,
          instance_path=r"C:\Users\Orbit\RPOSS\instance")
  app.config.from_object('config')
  app.config.from_pyfile('config.py')
  
  bcrypt = Bcrypt(app)
  Session = sessionmaker(bind=engine)
  db_session = Session()
  Bootstrap(app)
  
  app.register_blueprint(Cmod)
  app.register_blueprint(Rmod, url_prefix="/RPOSS")
  app.register_blueprint(Omod, url_prefix="/RPOSS/owner_panel")
  app.register_blueprint(Smod, url_prefix="/RPOSS/progressive_panel")
  </code></pre>
  
  <p><code>RPOSS/app/views.py</code>:</p>
  
  <pre><code>from flask import ...
  from app.forms import ...
  from app.models import ClassName
  
  
  Rmod = Blueprint('RPOSS', __name__,
               template_folder='templates',
               static_folder='static')
  </code></pre>
  
  <p><code>RPOSS/app/models.py</code>:</p>
  
  <pre><code>from app import bcrypt
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy import ... 
  
  
  Base = declarative_base()
  
  
  class ClassName(Base):
      # I am using bcrypt here to hash values
      ...
  </code></pre>
  
  <p>Note: I ran the model and the database was created and everything was working fine.</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/Orbit/RPOSS/app/models.py", line 1, in &lt;module&gt;
      from app import bcrypt
    File "C:\Users\Orbit\RPOSS\app\__init__.py", line 7, in &lt;module&gt;
      from app.views import Rmod
    File "C:\Users\Orbit\RPOSS\app\views.py", line 3, in &lt;module&gt;
      from app.models import Employee
    File "C:\Users\Orbit\RPOSS\app\models.py", line 1, in &lt;module&gt;
      from app import bcrypt
  ImportError: cannot import name 'bcrypt'
  </code></pre>
  
  <p>Can someone help me figuring out what happened?</p>