Python报错:TypeError: __init__() got an unexpected keyword argument 'io_loop' 原因及解决方案

今天打开一个Python文件时,报错提示:

TypeError: __init__() got an unexpected keyword argument ‘io_loop‘

明明是从旧电脑上拷贝到新电脑上的文件,之前运行是OK的,新电脑上运行怎么就报错了呢?

错误原因:

配置python环境时,默认tornado版本是最新的版本(恰好我新电脑重新配置了python环境,所以安装了最新版本),但是在4.0版本之后就废弃了io_loop参数。

解决方案:

1. 先卸载当前安装的tornado

pip uninstall tornado

2. 安装低版本的tornado

pip install tornado==4.1

Python报错:TypeError: __init__() got an unexpected keyword argument 'io_loop' 原因及解决方案

原文地址:https://www.cnblogs.com/daniumiqi/p/12148239.html

时间: 2024-07-29 23:45:41

Python报错:TypeError: __init__() got an unexpected keyword argument 'io_loop' 原因及解决方案的相关文章

TypeError: __init__() got an unexpected keyword argument 'strict'

使用requests发请求时发生报错 TypeError: __init__() got an unexpected keyword argument 'strict' 莫慌,不是你代码写错了,是因为请求模块requests不是最新的 只需要 pip install requests --upgrade 就OK了 TypeError: __init__() got an unexpected keyword argument 'strict' 原文地址:https://www.cnblogs.c

【Django Rest Framework】TypeError: __init__() got an unexpected keyword argument 'name'

前端Vue问题描述: 通过面包屑导航,无法获取导航分类对应商品列表 后端问题描述:# 报错提示 File "D:\Envs\vueshop\lib\site-packages\django_filters\filterset.py", line 258, in form Form = self.get_form_class() File "D:\Envs\vueshop\lib\site-packages\django_filters\filterset.py",

python 报错TypeError: 'range' object does not support item assignment,解决方法

贴问题 nums = range(5)#range is a built-in function that creates a list of integers print(nums)#prints "[0,1,2,3,4]" print(nums[2:4])#Get a slice from index 2 to 4 (exclusive); prints '[2,3]" print(nums[2:])#Get a slice from index 2 to the end

执行python manage.py makemigrations时报错TypeError: __init__() missing 1 required positional argument: 'on_delete'

在执行python manage.py makemigrations时报错: TypeError: __init__() missing 1 required positional argument: 'on_delete' 解决方法: 在连接外键时加上: on_delete=models.CASCADE 执行python manage.py makemigrations时报错TypeError: __init__() missing 1 required positional argument

django2.1发生Django TypeError: render() got an unexpected keyword argument 'renderer

1. 修改 xadmin 源代码1.在Python终端输入命令help(‘xadmin’) 查看xadmin安装位置 得到如下输出 FILE /root/anaconda3/envs/learndjango/lib/python3.5/site-packages/xadmin/__init__.py122.进入xadmin安装路径,编辑xadmin/views/dashboard.py, 搜索所有xadmin 下的代码,有通通给这个方法加参数 renderer=None #render() go

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

在网上看到MXShop这个项目,适合Python, Django + drf 进阶的,其中遇到 TypeError: render() got an unexpected keyword argument 'renderer', 在百度一番后发现是Django集成DjangoUeditor,才导致这个错误的.网上有什么资料都是去改Django的源文件,但是我觉得这样很不好,因为部署到新环境的时候,都要手动去改一下Django源文件,这样太麻烦了 所以打算在DjangoUeditor上找原因,最后

senlin __init__() got an unexpected keyword argument 'additional_headers'

从senlin源码重新编译更新了服务,然后执行 senlin的 cli就遇到了错误: __init__() got an unexpected keyword argument 'additional_headers' 谷歌了一下,找到这份开发者的聊天日志: http://eavesdrop.openstack.org/irclogs/%23senlin/%23senlin.2016-08-16.log.html 知道是client没有更新的缘故,于是我执行了: $sudo pip instal

【转】python 调用super()初始化报错“TypeError: super() takes at least 1 argument”

一.实验环境 1.Windows7x64_SP1 2.Anaconda2.5.0 + python2.7(anaconda集成,不需单独安装) 二.实验步骤 2.1 在python中有如下代码: class father(): def __init__(self,age): self.age = age; def get_age(self): print(self.age); class son(father): def __init__(self,age): super().__init__(

python报错 TypeError: string indices must be integers

所以在读取字典的时候,最好先判断类型,然后再查看它是否已经有这样的属性: type(mydict) == type({})             #检查不是字典 如果是字典,再看看有没有这样的属性:mydict.has_key('mykey') 1. 看看变量是否是字典   2.检查字典是否有对应的key值 if 'like' in condition: cond_str1 = condition.split('like')[0].strip() cond_str2 = condition.s