'celery' object has no attribute 'utils
来源:互联网 发布:淘宝怎么搜好看的衣服 编辑:程序博客网 时间:2024/06/05 23:42
问题:
以前经常使用celery.utils.uuid()获取通用唯一识别码,但在celery 4.1.0中使用时出现报错:
‘celery’ object has no attribute ‘utils
原因:
版本更新导致的不兼容问题。
官方给出的说法:
celery.utils
Utility functions.
Don’t import from here directly anymore, as these are only here for backwards compatibility.
其中关于uuid的解释:
celery.utils.uuid(_uuid=)
Generate unique id in UUID4 format.See also**For now this is provided by uuid.uuid4().**
根据提示,获取通用唯一识别码以后应该使用uuid.uuid4():
>>> import uuid>>> uuid.uuid4()UUID('307a7475-afe7-473a-abac-4d6acad50c7f')>>> str(uuid.uuid4())'7cbab6fa-883c-4970-a0bb-ea16938cc099'>>>
参考:
官方链接
http://docs.celeryproject.org/en/latest/internals/reference/celery.utils.html
阅读全文
0 0
- 'celery' object has no attribute 'utils
- object has no attribute 'cleaned_data'
- 'ContactForm' object has no attribute 'clean_data'
- AttributeError: 'classmethod' object has no attribute '__module__'
- AttributeError: 'module' object has no attribute 'getpass'
- 'module' object has no attribute 'basicConfig'
- AttributeError: ‘NoneType’ object has no attribute ‘clone’
- 'SafeUnicode' object has no attribute 'status_code'
- AttributeError: 'module' object has no attribute 'Serial'
- AttributeError: 'NoneType' object has no attribute 'clone'
- unicode' object has no attribute 'read' json
- ‘dict’ object has no attribute 'has_key'解决办法
- 'MPD' object has no attribute 'myIP'
- 'module' object has no attribute 'rindex'
- AttributeError: 'tuple' object has no attribute 'Multi'
- 'WSGIRequest' object has no attribute 'raw_post_data'
- AttributeError: 'Response' object has no attribute 'json'
- TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
- 拼写检查
- bzoj2326 [HNOI2011]数学作业
- AI开发实战7-列表显示框(Listview)的定制
- [.cpp]位运算程序设计_找出判断题答案
- centos 下如何修改网卡名称
- 'celery' object has no attribute 'utils
- Linux 忘记密码解决方法
- mysql删除带外键数据问题
- 扑克牌顺子
- mysql installation guide (windows)
- V8 内存分配与垃圾回收
- python调试
- 有关Vector和List的各自优势
- linux开启bbr