celery:Unrecoverable error: AttributeError("'unicode' object has no attribute 'iteritems')
环境描述
python2+django1.9下使用celery异步处理耗时请求。
celery使用的是celery-with-redis这个第三方库,版本号为3.0。
pip install celery-with-redis
这样安装会将redis、celery-with-redis、redis等一起同时安装。
错误描述
错误提示:Unrecoverable error: AttributeError("'unicode' object has no attribute 'iteritems')
问题发现及解决
将这个错误Google后,在stackoverflow中发现了解决办法,地址:stack overflow,celery-github
问题的症结是redis的版本号为3.0以上,导致celery将其作为消息中间件的时候出现问题,给出的解决方案是安装3.0以下的redis版本。这里我们安装redis==2.10.6
- 首先
pip uninstall redis
- 其次
pip install redis==2.10.6
- 最后
重新运行celery即可。
celery worker -A xxx -l INFO
celery:Unrecoverable error: AttributeError("'unicode' object has no attribute 'iteritems')的更多相关文章
- AttributeError: 'unicode' object has no attribute 'tzinfo' 未解决
Internal Server Error: /demo/machineinfo.htmlTraceback (most recent call last): File "C:\Python ...
- AttributeError: 'dict' object has no attribute 'iteritems'
在python3.6中运行 sortedClassCount = sorted(classCount.iteritems(), key=operator.itemgetter(1), reverse= ...
- facenet pyhton3.5 训练 train_softmax.py 时报错AttributeError: 'dict' object has no attribute 'iteritems'
报错原因:在进行facenet进行train_softmax.py训练时,在一轮训练结束进行验证时,报错AttributeError: 'dict' object has no attribute ' ...
- 机器学习实战:KNN代码报错“AttributeError: 'dict' object has no attribute 'iteritems'”
报错代码: sortedClassCount = sorted(classCount.iteritems(), key=operator.itemgetter(1), reverse=True) 解决 ...
- mygenerator().next() AttributeError: 'generator' object has no attribute 'next'
def mygenerator(): print ("start ...") yield 5 mygenerator() print ("mygenerator():&q ...
- AttributeError: 'list' object has no attribute 'sorted'
效果图: 解决办法: 原因: AttributeError: 'list' object has no attribute 'sorted' 属性错误: list对象没有sorted属性方法. sor ...
- 解决window7 x64位Anaconda启动报错:AttributeError: '_NamespacePath' object has no attribute 'sort'
最近论文需要用到python做数据分析,python语法简单,但是Windows下安装第三方包恶心的要命,statsmodels用pip死活安装不上,网上查了说包相互依赖windows下的pip不能下 ...
- 解决Win7(x64)Anaconda3报错:AttributeError: '_NamespacePath' object has no attribute 'sort'
最近论文需要用到python做数据分析,python语法简单,但是Windows下安装第三方包恶心的要命,statsmodels用pip死活安装不上,网上查了说包相互依赖windows下的pip不能下 ...
- Django 运行报异常:AttributeError: 'str' object has no attribute 'get'
Technorati Tags: Python,Django,Web 在使用django.contrib.auth用户机制进行用户的验证.登录.注销操作时,遇到这个异常. 首先是写了一个登录的视图,要 ...
随机推荐
- linux下生成随机密码
常见的简单的两种方法 1.openssl rand -base64 32 2.date | md5sum
- Sharepoint JSCOM 列表操作
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', retrieveListItemsInclude); //确保js文件加载,再执行方法 function ...
- 新手常见Python运行时错误
经过整理与在实际中遇到的问题,将新手经常遇到的汇总下,以便自己犯傻又这么干了 1)"SyntaxError :invalid syntax",语法错误 A.查看是否在 if , e ...
- [转]logX<X对所有的X>0成立
本文引用地址:http://blog.sciencenet.cn/blog-1865911-831450.html 此文来自科学网何召卫博客,转载请注明出处. 这个命题网上有多种证法,有人甚至采用斜率 ...
- clipboard JS(剪切板)的使用
引入js(根据路径需要修改url) <script src="lib/clipboard/clipboard.min.js" type="text/javascri ...
- Oracle同义词。。。
同义词 --私有同义词--私有同义词权限grant create synonym to scott;--创建私有同义词create synonym dp for scott.dept;--将查询dep ...
- String与Date转换
public class TimeTraining { public static void changeStr(String str){ str = "137878"; } pu ...
- ${fn:} 函数
调用这样一个头文件<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions " ...
- pta 编程题13 File Transfer
其它pta数据结构编程题请参见:pta 这道题考察的是union-find并查集. 开始把数组中每个元素初始化为-1,代表没有父节点.为了使树更加平衡,可以让每一个连通分量的树根的负值代表这个连通分量 ...
- linux 命令——35 ln(转)
ln 是linux中又一个非常重要命令,它的功能是为某一个文件在另外一个位置建立一个同步的链接.当我们需要在不同的目录,用到相同的文件时,我们不需要在每一个需要的目录下都放一个必须相同的文件,我们只要 ...