0

I have problem when I try to create a database in SQLAlchemy:

from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker

Database

import models

class Database:

    def __init__(self, db_url):
        engine = create_engine(db_url)
        models.Base.metadata.create_all(bind=engine)
        self.maker = sessionmaker(bind=engine)

the error is following:

    plugins = u._instantiate_plugins(kwargs)
AttributeError: 'NoneType' object has no attribute '_instantiate_plugins'
NIk
  • 123
  • 5
  • Your object is a NoneType, which means that your are not retrieving anything. Is empty. First step should be to check your object and why you are getting an NoneType object. – Noohone Jan 05 '21 at 08:16
  • Please edit your questionto include the _complete_ error traceback and the value of `db_url`. – snakecharmerb Jan 05 '21 at 08:19
  • Does this answer your question? [AttributeError: 'NoneType' object has no attribute '\_instantiate\_plugins' (Cannot import create\_engine)](https://stackoverflow.com/questions/61238025/attributeerror-nonetype-object-has-no-attribute-instantiate-plugins-canno) – rfkortekaas Jan 05 '21 at 09:46

0 Answers0