环境描述

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')的更多相关文章

  1. AttributeError: 'unicode' object has no attribute 'tzinfo' 未解决

    Internal Server Error: /demo/machineinfo.htmlTraceback (most recent call last): File "C:\Python ...

  2. AttributeError: 'dict' object has no attribute 'iteritems'

    在python3.6中运行 sortedClassCount = sorted(classCount.iteritems(), key=operator.itemgetter(1), reverse= ...

  3. facenet pyhton3.5 训练 train_softmax.py 时报错AttributeError: 'dict' object has no attribute 'iteritems'

    报错原因:在进行facenet进行train_softmax.py训练时,在一轮训练结束进行验证时,报错AttributeError: 'dict' object has no attribute ' ...

  4. 机器学习实战:KNN代码报错“AttributeError: 'dict' object has no attribute 'iteritems'”

    报错代码: sortedClassCount = sorted(classCount.iteritems(), key=operator.itemgetter(1), reverse=True) 解决 ...

  5. mygenerator().next() AttributeError: 'generator' object has no attribute 'next'

    def mygenerator(): print ("start ...") yield 5 mygenerator() print ("mygenerator():&q ...

  6. AttributeError: 'list' object has no attribute 'sorted'

    效果图: 解决办法: 原因: AttributeError: 'list' object has no attribute 'sorted' 属性错误: list对象没有sorted属性方法. sor ...

  7. 解决window7 x64位Anaconda启动报错:AttributeError: '_NamespacePath' object has no attribute 'sort'

    最近论文需要用到python做数据分析,python语法简单,但是Windows下安装第三方包恶心的要命,statsmodels用pip死活安装不上,网上查了说包相互依赖windows下的pip不能下 ...

  8. 解决Win7(x64)Anaconda3报错:AttributeError: '_NamespacePath' object has no attribute 'sort'

    最近论文需要用到python做数据分析,python语法简单,但是Windows下安装第三方包恶心的要命,statsmodels用pip死活安装不上,网上查了说包相互依赖windows下的pip不能下 ...

  9. Django 运行报异常:AttributeError: 'str' object has no attribute 'get'

    Technorati Tags: Python,Django,Web 在使用django.contrib.auth用户机制进行用户的验证.登录.注销操作时,遇到这个异常. 首先是写了一个登录的视图,要 ...

随机推荐

  1. CodeForces - 186A-Comparing Strings

    Some dwarves that are finishing the StUDY (State University for Dwarven Youngsters) Bachelor courses ...

  2. Sandcastle Help File Builder 生成NET帮助文档

    Sandcastle是微软提供的一个根据XML注释和DLL文件生成帮助文件的工具,目前是在CodePlex上的一个开源项目,可以去这里下载:Sandcastle Sandcastle生成的输出结果具有 ...

  3. C++之Vect

    在C++中数组和向量都是多同类元素的集合,他们也有很明显的区别 1 数组属于静态分配,编译之前必须知道数组的大小,一旦确定就不能更改:2个数组之间不能直接赋值实现拷贝,而必须显式用for或者拷贝函数拷 ...

  4. how to keep impact-crusher in good condition

    how to keep impact-crusher in good condition Why we have to maintenance impact crusher? As we talked ...

  5. Eventlet Greenlet

    Eventlet是一个用来处理和网络相关的python网络库,而且可以通过协程来实现并发,在eventlet里,把“协程”叫做greenthread. 所谓并发,就是开启了多个greenthread, ...

  6. 系统启动时,BIOS与影子内存_5

    问题:“当我们按下电源开关时,电源开始供电,芯片组撤去RESET信号,CPU马上就从地址FFFF0H处开始执行指令,这个地址在系统BIOS的地址范围内,无论是Award BIOS还是AMI BIOS, ...

  7. map 常用方法

    map遍历: Map map = new HashMap(); Iterator it = map.entrySet().iterator(); while(it.hasNext()) { Map.E ...

  8. js固定两位小数toFixed(2)

    total=total.toFixed(3); 小数问题:可以number(),或者*1来改变变量类型.

  9. 大数据“重磅炸弹”——实时计算框架 Flink

    Flink 学习 项目地址:https://github.com/zhisheng17/flink-learning/ 博客:http://www.54tianzhisheng.cn/tags/Fli ...

  10. phpize使用方法

    phpize是用来扩展php扩展模块的,通过phpize可以建立php的外挂模块,下面介绍一个它的使用方法,需要的朋友可以参考下 安装(fastcgi模式)的时候,常常有这样一句命令: 代码如下: / ...