Django 報錯 ModuleNotFoundError: No module named celery.utils.timeutils

  File "/root/training/Python-3.7.0/lib/python3.7/site-packages/djcelery/models.py", line 15, in <module>
    from celery.utils.timeutils import timedelta_seconds
ModuleNotFoundError: No module named 'celery.utils.timeutils'

https://blog.csdn.net/lizhihua0925/article/details/53185296

原因: 新的celery 4.0與 django-celery 3.1.17不兼容 解決方法: 安裝celery 3.1.x版本

參考了這個博主說的,不兼容,但是我是剛把celery升級到4.0的,再回退肯定不行

用了錯誤的命令,剛好給看到現有的版本,就選了一個稍微高一點的django-celery==3.3.0安裝

 Could not find a version that satisfies the requirement django-celery==4.0.2 (from versions: 2.0.0, 2.0.2, 2.0.3, 2.1.0, 2.1.1, 2.1.2, 2.1.4, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.7, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 3.0.0, 3.0.1, 3.0.4, 3.0.6, 3.0.9, 3.0.10, 3.0.11, 3.0.17, 3.0.21, 3.0.23, 3.1.0, 3.1.1, 3.1.9, 3.1.10, 3.1.15, 3.1.16, 3.1.17, 3.2.1, 3.2.2, 3.3.0, 3.3.1)
ERROR: No matching distribution found for django-celery==4.0.2

# 裝完OK了,解決其他問題
pip install django-celery==3.3.0

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章