Sqlalchemy errror:obj必须是类型的实例或子类型

时间:2018-06-07 01:54:41

标签: pandas sqlalchemy

运行以下代码时出现以下错误:

File "E:\ProgramData\Anaconda3\lib\site-packages\sqlalchemy\sql\visitors.py", line 60, in __init__
    super(VisitableType, cls).__init__(clsname, bases, clsdict)
TypeError: super(type, obj): obj must be an instance or subtype of type

代码:

import pandas as pd
import mysql.connector
import sqlalchemy as sl

engine=sl.create_engine('mysql+mysqlconnector://root:xxxx@11.11.11.11:3306/kafka')

df = pd.read_sql('select * from kafka_test limit 10', con=engine)
df.head()

0 个答案:

没有答案