title: create_engine() missing 1 required positional argument: 'engine_opts
body: <p>app was running fine yesterday at home on <strong>a different system **when i tried to run it on the different system ( **freshly installed everything</strong> ) - <em>so i assume that this error is just for the latest version only.</em></p>
  
  <p>the goal is to connect the user in session to a second database</p>
  
  <p><strong>i got this error:</strong>
  <code>create_engine() missing 1 required positional argument: 'engine_opts'</code></p>
  
  <p><strong>My current code:</strong></p>
  
  <pre><code>app.config['SQLALCHEMY_DATABASE_URI'] = "postgres:// ****" #main database
  app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = "True"
  app.config['SQLALCHEMY_ENGINE_OPTIONS'] = "None" #i didnt have that line in my system 
  before i've just added it in attempt of fixing this issue
  
  db = SQLAlchemy(app,session_options={"autoflush": False})
  
  
  @app.route('/test')
  def test():
      x = 'postgres://*****' #secondary database for user in session only.
      engine = db.create_engine(x)
  
  return ''
  </code></pre>
  
  <p>Things I've tried :</p>
  
  <p><strong>checking the library page :</strong> <a href="https://flask-sqlalchemy.palletsprojects.com/en/2.x/api/?highlight=engine_opts" rel="nofollow noreferrer">flask_SQLAlchemy Library</a></p>
  
  <p>all i found about it was this:</p>
  
  <blockquote>
    <p><strong>create_engine</strong>(<em>sa_url, engine_opts</em>) Override this method to have final
    say over how the SQLAlchemy engine is created.</p>
    
    <p>In most cases, you will want to use 'SQLALCHEMY_ENGINE_OPTIONS' config
    variable or set engine_options for SQLAlchemy().</p>
  </blockquote>
  
  <p>after googling around i saw some examples and none of them worked.</p>
  
  <p><strong>Attempt #01 :</strong></p>
  
  <p><code>db.create_engine(DB_URL,**engine_opts)</code>  </p>
  
  <p><em>Output:</em></p>
  
  <blockquote>
    <p>NameError: name 'engine_opts' is not defined</p>
  </blockquote>
  
  <p><strong>Attempt #02 :</strong></p>
  
  <p><code>db.create_engine(DB_URL,**db.engine_opts)</code></p>
  
  <p><em>Output:</em></p>
  
  <blockquote>
    <p>AttributeError: 'SQLAlchemy' object has no attribute 'engine_opts'</p>
  </blockquote>
  
  <p><strong>Attempt #03 :</strong></p>
  
  <p><code>db.create_engine(DB_URL,engine_opts='None')</code></p>
  
  <p><em>Output:</em></p>
  
  <blockquote>
    <p>TypeError: create_engine() argument after ** must be a mapping, not str</p>
  </blockquote>
  
  <p><strong>Attempt #04 :</strong></p>
  
  <p><code>db.create_engine(DB_URL,engine_opts=None)</code></p>
  
  <blockquote>
    <p>TypeError: create_engine() argument after ** must be a mapping, not NoneType</p>
  </blockquote>
  
  <p><strong>Attempt #05 :</strong></p>
  
  <p><code>db.create_engine(xDB,db.engine_opts='None')</code></p>
  
  <p>System crashes <strong>"didnt even run"</strong> :</p>
  
  <blockquote>
    <p>SyntaxError: keyword can't be an expression</p>
  </blockquote>
  
  <p><strong>Attempt #06 :</strong></p>
  
  <p><code>db.create_engine(xDB,{'SQLALCHEMY_ENGINE_OPTIONS': None})</code></p>
  
  <p><em>Output:</em></p>
  
  <pre><code> return self.view_functions[rule.endpoint](**req.view_args)
    File "C:\project1\app.py", line 175, in test
      engine = db.create_engine(xDB,{'SQLALCHEMY_ENGINE_OPTIONS': None})
    File "C:\Users\Rick\AppData\Local\Programs\Python\Python37\lib\site-packages\flask_sqlalchemy\__init__.py", line 966, in create_engine
      return sqlalchemy.create_engine(sa_url, **engine_opts)
    File "C:\Users\Rick\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\engine\__init__.py", line 435, in create_engine
      return strategy.create(*args, **kwargs)
    File "C:\Users\Rick\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\engine\strategies.py", line 87, in create
      dbapi = dialect_cls.dbapi(**dbapi_args)
    File "C:\Users\Rick\AppData\Local\Programs\Python\Python37\lib\site-packages\sqlalchemy\dialects\postgresql\psycopg2.py", line 632, in dbapi
      import psycopg2
  ModuleNotFoundError: No module named 'psycopg2'
  </code></pre>
  
  <p><strong>Attempt #07 :</strong></p>
  
  <p>after installing <code>psycopg2</code> based on #Attempt06</p>
  
  <p><code>db.create_engine(xDB,{'SQLALCHEMY_ENGINE_OPTIONS': None})</code></p>
  
  <p><em>Output:</em></p>
  
  <pre><code>TypeError: Invalid argument(s) 'SQLALCHEMY_ENGINE_OPTIONS' sent to create_engine(), using configuration PGDialect_psycopg2/QueuePool/Engine.  Please check that the keyword arguments are appropriate for this combination of components.
  </code></pre>