网上很多写法都是 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. msyql中myism和innodb的区别

    MyISAM存储引擎 MyISAM是 默认存储引擎.它基于更老的ISAM代码,但有很多有用的扩展.MyISAM存储引擎的一些特征: ●所有数据值先存储低字节.这使得数据机和操作系统分离.二进制轻便性的 ...

  2. LeetCode Binary Tree Tilt

    原题链接在这里:https://leetcode.com/problems/binary-tree-tilt/description/ 题目: Given a binary tree, return ...

  3. LeetCode Perfect Number

    原题链接在这里:https://leetcode.com/problems/perfect-number/#/description 题目: We define the Perfect Number ...

  4. pair对组

    一.pair基本概念 对组(pair)将一对值组合成一个值,这一对值可以具有不同的数据类型,两个值可以分别用pair的两个公有函数first和second访问. 类模板:template <cl ...

  5. 简谈Tomcat调优

    一.Tomcat和apache的比较 共同点:apache和tomcat都是属于web服务器. 不同点:他们是两个不同的容器,承载的东西不一样,tomcat属于一种java应用的服务 器,只针对jav ...

  6. snmpwalk用法

    snmpwalk语法:snmpwalk 交换机或路由器IP地址 -c SNMP读密码 -v 1或2(代表SNMP版本) OID(对象标示符) 用法举例:1.snmpwalk -c public -v ...

  7. 一行删除所有docker container的命令

    ns=`docker | awk '//{print $1}'`;for n in $ns;do docker rm -f $n;done docker | awk '{print $1}'|xarg ...

  8. 解决 ASP.NET Chart 控件出错 为 ChartImg.axd 执行子请求时出错

        今天在做一个关于MVC的MSChart时,本以为很简单的一个东西,后面把数据什么的都绑定好后,满以为OK了,一运行就报错“ ASP.NET Chart 控件出错 为 ChartImg.axd ...

  9. 蓝桥杯 算法训练 ALGO-142 P1103

    算法训练 P1103   时间限制:1.0s   内存限制:256.0MB 编程实现两个复数的运算.设有两个复数 和 ,则他们的运算公式为: 要求:(1)定义一个结构体类型来描述复数. (2)复数之间 ...

  10. Caused by: java.lang.IncompatibleClassChangeError: Implementing class

    Caused by: java.lang.IncompatibleClassChangeError: Implementing class 可能是导入的jar包重复. 尤其在Maven引用中,请查看是 ...