开发者社区> 问答> 正文

python+rabbitmq运行报错 ?报错

文档中有声明交换器
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的内置函数,一直找不到解决办法,
希望各位大神帮忙解惑

展开
收起
爱吃鱼的程序员 2020-06-23 00:00:42 493 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    找不到原因,我改成
    "hello-exchange",
    "direct",
    False,
    True,
    False

    后可以使用,
    把变量去掉了

    http://blog.csdn.net/fgf00/article/details/52872730

    2020-06-23 00:00:59
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载