为了账号安全,请及时绑定邮箱和手机立即绑定

数据库连接

创建数据库这一块一直出现这个问题,一直不知道要怎么解决?有会的大神可以帮忙以下吗

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.


正在回答

1 回答

应该是没有创建数据表

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

数据库连接

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信