AttributeError: 'module' object has no att

2019-08-18 03:44发布

问题:

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}

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

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

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

回答1:

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))