数据库连接

来源:3-1 根据项目需求设计mysql数据库结构

慕无忌3475426

2020-01-05 12:27

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

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回答

  • weixin_慕九州520781
    2020-03-05 19:15:46

    应该是没有创建数据表

Python爬虫实战数据可视化分析

网站数据收集分析必备技能

4276 学习 · 29 问题

查看课程

相似问题