數(shù)據(jù)庫連接
創(chuàng)建數(shù)據(jù)庫這一塊一直出現(xiàn)這個問題,一直不知道要怎么解決?有會的大神可以幫忙以下嗎
D:\python\imooc_lagou\venv\Scripts\python.exe D:/python/imooc_lagou/create_lagou_tables.py
Traceback (most recent call last):
? File "D:/python/imooc_lagou/create_lagou_tables.py", line 17, in <module>
? ? class Lagoutables(Base):
? File "D:\python\imooc_lagou\venv\lib\site-packages\sqlalchemy\ext\declarative\api.py", line 75, in __init__
? ? _as_declarative(cls, classname, cls.__dict__)
? File "D:\python\imooc_lagou\venv\lib\site-packages\sqlalchemy\ext\declarative\base.py", line 131, in _as_declarative
? ? _MapperConfig.setup_mapping(cls, classname, dict_)
? File "D:\python\imooc_lagou\venv\lib\site-packages\sqlalchemy\ext\declarative\base.py", line 160, in setup_mapping
? ? cfg_cls(cls_, classname, dict_)
? File "D:\python\imooc_lagou\venv\lib\site-packages\sqlalchemy\ext\declarative\base.py", line 192, in __init__
? ? self._setup_inheritance()
? File "D:\python\imooc_lagou\venv\lib\site-packages\sqlalchemy\ext\declarative\base.py", line 589, in _setup_inheritance
? ? "table-mapped class." % cls
sqlalchemy.exc.InvalidRequestError: Class <class '__main__.Lagoutables'> does not have a __table__ or __tablename__ specified and does not inherit from an existing table-mapped class.
2020-03-05
應(yīng)該是沒有創(chuàng)建數(shù)據(jù)表