title: sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres
body: <p>I'm trying to connect to a Postgres database with SQLAlchemy. I've installed psycopg2. However, I get the error <code>sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres</code>. How do I configure SQLAlchemy to connect to PostgreSQL?</p>
  <pre class="lang-py prettyprint-override"><code>from flask import Flask
  from flask_sqlalchemy import SQLAlchemy
  
  app = Flask(__name__)
  app.config[&quot;SQLALCHEMY_DATABASE_URI&quot;] = &quot;postgres://username@localhost:5432/template1&quot;
  
  db = SQLAlchemy(app)
  </code></pre>