学习python-mysql:报错AttributeError: module 'MySQLdb' has no attribute 'cursors'

爬虫写入数据库时报错:

AttributeError: module 'MySQLdb' has no attribute 'cursors'

在这里插入图片描述
解决方法:
引入

import MySQLdb.cursors# 引入这个依赖

如下所示

import codecs
import json
from scrapy.pipelines.images import ImagesPipeline
from scrapy.exporters import JsonItemExporter
from twisted.enterprise import adbapi
import MySQLdb
import MySQLdb.cursors# 引入这个依赖

猜你喜欢

转载自blog.csdn.net/webfullstack/article/details/82961066