您的位置: 首页 > 文章 > 关于celery的bug解决方法:AttributeError: module 'celery_tasks' has no attribute 'celery' 关于celery的bug解决方法:AttributeError: module 'celery_tasks' has no attribute 'celery' 分类: 文章 • 2023-04-05 17:15:17 最近写代码突然出现了关于celery属性出错的问题,在网上查了很久也没有找到解决方法,后来重新检查代码才发现是代码的写错误了。 Bug截图 解决方法 检查代码是否出错: 错误代码:celery -A celery_tasks worker -l info 正确代码:celery -A celery_tasks.main worker -l info' 分析:celery属性是在main文件中,只有执行了main文件才能找到celery属性