AttributeError: 'module' 对象没有属性 'AsyncoreConnection'

问题描述:

我正在使用 scrapy-rabbitmq 从 RabbitMQ 获取 url 到我的 scrapy.我在我的 settings.py 文件中使用以下内容

I am using scrapy-rabbitmq to fetch the url from RabbitMQ into my scrapy.I am using the following in my settings.py file

RABBITMQ_CONNECTION_PARAMETERS = {"credentials": pika.PlainCredentials('test', 'test'),'host': '10.0.12.103', 'port': 5672}

但我无法连接到rabbitmq.我收到以下错误

But I am unable to connect to the rabbitmq .I am getting the foloowing error

AttributeError: 'module' object has no attribute 'AsyncoreConnection'

我问了另一个问题,即如何使用 scrapy 这里

I have asked a another question that how to consume the data from RabbitmQ using scrapy here

我不得不在其源代码 (connection.py) 中注释这一行.

I had to comment this line on its source code (connection.py).

    connection = {
    'blocking': pika.BlockingConnection,
    #'asyncore': pika.AsyncoreConnection,
    #'libev': pika.LibevConnection,
    'select': pika.SelectConnection,
    #'tornado': pika.TornadoConnection,
    #'twisted': pika.TwistedConnection
}[connection_type](pika.ConnectionParameters(**connection_parameters))