|

楼主 |
发表于 2019-4-7 12:37:37
|
显示全部楼层
他说缺少一个光标..
AttributeError Traceback (most recent call last)
<ipython-input-5-bf14fd44c518> in <module>()
2 import sqlite3
3
----> 4 df = pd.read_sql("豆瓣.db",con=sqlite3)
D:\bzdsrj\lib\site-packages\pandas\io\sql.py in read_sql(sql, con, index_col, coerce_float, params, parse_dates, columns, chunksize)
379 sql, index_col=index_col, params=params,
380 coerce_float=coerce_float, parse_dates=parse_dates,
--> 381 chunksize=chunksize)
382
383 try:
D:\bzdsrj\lib\site-packages\pandas\io\sql.py in read_query(self, sql, index_col, coerce_float, params, parse_dates, chunksize)
1411
1412 args = _convert_params(sql, params)
-> 1413 cursor = self.execute(*args)
1414 columns = [col_desc[0] for col_desc in cursor.description]
1415
D:\bzdsrj\lib\site-packages\pandas\io\sql.py in execute(self, *args, **kwargs)
1371 cur = self.con
1372 else:
-> 1373 cur = self.con.cursor()
1374 try:
1375 if kwargs:
AttributeError: module 'sqlite3' has no attribute 'cursor' |
-
|