文档中有声明交换器
channel.exchange_declare(exchange="hello-exchange",
type="direct",
passive=False,
durable=True,
auto_delete=False)
用了type,
运行报错
➜ chapter-2 python ./hello_world_consumer.py
Traceback (most recent call last):
File "./hello_world_consumer.py", line 14, in
auto_delete=False)
TypeError: exchange_declare() got an unexpected keyword argument 'type'
➜ chapter-2
查资料可能因为type是python的内置函数,一直找不到解决办法,
希望各位大神帮忙解惑
python+rabbitmq运行报错
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- 一个人的天气 2017-09-14 14:28关注
找不到原因,我改成
"hello-exchange",
"direct",
False,
True,
False后可以使用,
把变量去掉了本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报