回到顶部

阅读目录

解决:安装 django-celery-beat 自动把 django 升级到 3.0 了

 安装 beat 日志

(joyoo) E:\yinzhuoqun\djangos\joyoo>pip install django-celery-beat
Collecting django-celery-beat
  Downloading https://files.pythonhosted.org/packages/88/13/2dbab42ea826efab897d8638304d499078e0093e73c9b5fa19259e48ea94/django_celery_beat-1.5.0-py2.py3-none-any.whl
Collecting python-crontab>=2.3.4
  Downloading https://files.pythonhosted.org/packages/bc/03/852f9c5f8da7f58abce06fe8ae769cbcf6502f1c60684b16bad72ffcced3/python-crontab-2.4.0.tar.gz (50kB)
     |████████████████████████████████| 51kB 43kB/s
Collecting django-timezone-field>=2.0
  Downloading https://files.pythonhosted.org/packages/b3/23/ac06d9dcc9450b8ed51a7f861630b5ae4c1779c53401c83703fb87fbef39/django_timezone_field-4.0-py3-none-any.whl
Collecting python-dateutil
  Downloading https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227kB)
     |████████████████████████████████| 235kB 22kB/s
Requirement already satisfied: pytz in e:\py_virtualenv\joyoo\lib\site-packages (from django-timezone-field>=2.0->django-celery-beat) (2017.2)
Collecting django>=2.2
  Downloading https://files.pythonhosted.org/packages/43/d6/0aed0b12c66527748ce5a007da4618a65dfbe1f8fca82eccedf57d60295f/Django-3.0-py3-none-any.whl (7.4MB)
     |████████████████████████████████| 7.4MB 24kB/s
Requirement already satisfied: six>=1.5 in e:\py_virtualenv\joyoo\lib\site-packages (from python-dateutil->python-crontab>=2.3.4->django-celery-beat) (1.11.0)
Requirement already satisfied: sqlparse>=0.2.2 in e:\py_virtualenv\joyoo\lib\site-packages (from django>=2.2->django-timezone-field>=2.0->django-celery-beat) (0.3.0)
Collecting asgiref~=3.2
  Downloading https://files.pythonhosted.org/packages/a5/cb/5a235b605a9753ebcb2730c75e610fb51c8cab3f01230080a8229fa36adb/asgiref-3.2.3-py2.py3-none-any.whl
Building wheels for collected packages: python-crontab
  Building wheel for python-crontab (setup.py) ... done
  Created wheel for python-crontab: filename=python_crontab-2.4.0-cp36-none-any.whl size=25171 sha256=2adfbdce578785a6297d62e5e7a43eba4c53549ccdae6521a73393d75bf378a2
  Stored in directory: C:\Users\CJTDEV003\AppData\Local\pip\Cache\wheels\4b\09\db\93b493d70ba0d4e11dec3d7285d512909e4230627662fcb89b
Successfully built python-crontab
ERROR: django-haystack 2.6.1 has requirement Django<1.11, but you'll have django 3.0 which is incompatible.
Installing collected packages: python-dateutil, python-crontab, asgiref, django, django-timezone-field, django-celery-beat
  Found existing installation: Django 1.11.26
    Uninstalling Django-1.11.26:
      Successfully uninstalled Django-1.11.26
Successfully installed asgiref-3.2.3 django-3.0 django-celery-beat-1.5.0 django-timezone-field-4.0 python-crontab-2.4.0 python-dateutil-2.8.1

本人环境

  1. django 1.11
  2. python 3.6.8
  3. celery 4.3.0

解决方法

  1. 先卸载 django: pip uninstall django
  2. 再重新安装指定版本的 django:pip install django==1.11.26
  3. 安装日志提示版本有兼容性问题,目前暂未发现使用影响
(joyoo) E:\yinzhuoqun\djangos\joyoo>pip uninstall django
Uninstalling Django-3.0:
  Would remove:
    e:\py_virtualenv\joyoo\lib\site-packages\django-3.0.dist-info\*
    e:\py_virtualenv\joyoo\lib\site-packages\django\*
    e:\py_virtualenv\joyoo\scripts\django-admin.exe
    e:\py_virtualenv\joyoo\scripts\django-admin.py
Proceed (y/n)?
Your response ('') was not one of the expected responses: y, n
Proceed (y/n)? y
  Successfully uninstalled Django-3.0

(joyoo) E:\yinzhuoqun\djangos\joyoo>pip install django==1.11.26 -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting django==1.11.26
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/cf/19/632a613bc37bbf890f9323ba09374ce9af1d70bb4cba7ff4d3e5e0991b47/Django-1.11.26-py2.py3-none-any.whl (6.9MB)
     |████████████████████████████████| 7.0MB 1.3MB/s
Requirement already satisfied: pytz in e:\py_virtualenv\joyoo\lib\site-packages (from django==1.11.26) (2017.2)
ERROR: django-timezone-field 4.0 has requirement django>=2.2, but you'll have django 1.11.26 which is incompatible.
ERROR: django-haystack 2.6.1 has requirement Django<1.11, but you'll have django 1.11.26 which is incompatible.
Installing collected packages: django
Successfully installed django-1.11.26

 


^_^
请喝咖啡 ×

文章部分资料可能来源于网络,如有侵权请告知删除。谢谢!

前一篇: django 组装表名查询数据(动态表名、组合表名)
下一篇: python retry 和 retrying(失败重试)
captcha