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

主宰稳场 提交于 2019-12-13 03:47:13

问题


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


来源:https://stackoverflow.com/questions/52763064/attributeerror-module-object-has-no-attribute-asyncoreconnection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!