网上很多写法都是 type='fanout' 这样的。(这里是基于python=3.6版本, pika=0.13.0 版本)

credentials = pika.PlainCredentials('guest', 'guest')
connection = pika.BlockingConnection(pika.ConnectionParameters('127.0.0.1',5672,'/',credentials))
channel = connection.channel()
# 定义交换机,exchange表示交换机名称,type表示类型
channel.exchange_declare(exchange='logs_fanout', type='fanout')

抛出异常

channel.exchange_declare(exchange='logs_fanout', type='fanout')
TypeError: exchange_declare() got an unexpected keyword argument 'type'

应该把:type='fanout' 改成 change_type='fanout'

channel.exchange_declare(exchange='logs_fanout', exchange_type='fanout')

Python pika, TypeError: exchange_declare() got an unexpected keyword argument 'type' 问题修复的更多相关文章

  1. TypeError: exchange_declare() got an unexpected keyword argument 'type'

    在设置消息广播时:以下代码会报错channel.exchange_declare(exchange='direct_logs', type='direct')TypeError: exchange_d ...

  2. TypeError: parse() got an unexpected keyword argument 'transport_encoding'

    错误: TypeError: parse() got an unexpected keyword argument 'transport_encoding'You are using pip vers ...

  3. TypeError: __init__() got an unexpected keyword argument 't_command'

    python  .\manage.py migrate 报错如下 λ python .\manage.py migrateTraceback (most recent call last): File ...

  4. TypeError: pivot_table() got an unexpected keyword argument 'rows'

    利用Python进行数据分析>第二章,处理MovieLens 1M数据集,有句代码总是报错: mean_rating = data.pivot_table('rating', rows='tit ...

  5. TypeError: __init__() got an unexpected keyword argument 'serialized_options'

    问题描述: TypeError: __init__() got an unexpected keyword argument 'serialized_options' File "objec ...

  6. 记录 TypeError: render() got an unexpected keyword argument 'renderer' 错误

    在网上看到MXShop这个项目,适合Python, Django + drf 进阶的,其中遇到 TypeError: render() got an unexpected keyword argume ...

  7. 关于Jupyter Notebook无法自动补全(Autocompletion),报错TypeError: __init__() got an unexpected keyword argument 'column' 的解决方案

    关于Jupyter Notebook无法自动补全(Autocompletion),报错TypeError: __init__() got an unexpected keyword argument ...

  8. TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations'

    错误: TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations' 参照https://blog.c ...

  9. TypeError: to_categorical() got an unexpected keyword argument 'nb_classes'

    在学习莫烦教程中keras教程时,报错:TypeError: to_categorical() got an unexpected keyword argument 'nb_classes',代码如下 ...

随机推荐

  1. boost开发指南

    C++确实很复杂,神一样的0x不知道能否使C++变得纯粹和干爽? boost很复杂,感觉某些地方有过度设计和太过于就事论事的嫌疑,对实际开发工作的考虑太过于理想化.学习boost本身就是一个复杂度,有 ...

  2. windows下mysql提示Can't connect to MySQL server on 'localhost'

    1.开cmd输入mysqld --defaults-file="c:\Program Files (x86)\MySQL\MySQL Server 5.6\my-default.ini&qu ...

  3. 洛谷 P3223 [HNOI2012]排队

    题目描述 某中学有 n 名男同学,m 名女同学和两名老师要排队参加体检.他们排成一条直线,并且任意两名女同学不能相邻,两名老师也不能相邻,那么一共有多少种排法呢?(注意:任意两个人都是不同的) 输入输 ...

  4. swing之UI选择文件

    package gui1; import java.awt.Container; import java.awt.FlowLayout; import java.awt.event.ActionEve ...

  5. iptables的启动和关闭【转载】

    原文网址:http://os.51cto.com/art/201103/249049.htm iptables的启动和关闭: 1.启动和关闭iptables 下面将正式使用iptables来创建防火墙 ...

  6. MYSQLdump参数详解(转)

    mysqldump客户端可用来转储数据库或搜集数据库进行备份或将数据转移到另一个SQL服务器(不一定是一个MySQL服务器).转储包含创建表和/或装载表的SQL语句. 如果你在服务器上进行备份,并且表 ...

  7. POJ2976(最大化平均值)

    Dropping tests Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9329   Accepted: 3271 De ...

  8. clone对象的克隆

    用一句简单的话来说就是浅拷贝,只是对指针的拷贝,拷贝后两个指针指向同一个内存空间,深拷贝不但对指针进行拷贝,而且对指针指向的内容进行拷贝,经深拷贝后的指针是指向两个不同地址的指针. 等多 http:/ ...

  9. HTML 5中的结构元素

    1.header:标记头部区域的内容 .footer:标记页脚区域的内容 .section:Web页面中的一块区域 4.article:独立的文章内容区域 5.aside:相关侧边内容或者引文区域 6 ...

  10. iOS利用SDWebImage图片下载缓存

    一.我们先来了解一下SDWebImage的使用: 1.导入框架,引入头文件: #import "UIImageView+WebCache.h" 也可以直接使用CocoaPods来引 ...