AttributeError: 'module' 对象没有属性 'AsyncoreConnection' [英] AttributeError: 'module' object has no attribute 'AsyncoreConnection'

查看:70
本文介绍了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))

这篇关于AttributeError: 'module' 对象没有属性 'AsyncoreConnection'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆