Django-celery-beat: django.utils.six has been removed in django3

Created on 17 Nov 2019  路  14Comments  路  Source: celery/django-celery-beat

Summary:

Include a brief descrioption of the problem here, and fill out the version info below.

  • Celery Version:
  • Celery-Beat Version:

Exact steps to reproduce the issue:



    1. 2.
  1. 3.

Detailed information

django.utils.six has been removed in Django3

Most helpful comment

When will v2 be released?

All 14 comments

  • Django==3.0
  • django_celery_beat==1.5.0

Execute python3 manage.py runserver

Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/user/project/env/lib/python3.6/site-packages/django/utils/autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "/home/user/project/env/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "/home/user/project/env/lib/python3.6/site-packages/django/utils/autoreload.py", line 76, in raise_last_exception
    raise _exception[1]
  File "/home/user/project/env/lib/python3.6/site-packages/django/core/management/__init__.py", line 357, in execute
    autoreload.check_errors(django.setup)()
  File "/home/user/project/env/lib/python3.6/site-packages/django/utils/autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "/home/user/project/env/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/user/project/env/lib/python3.6/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/home/user/project/env/lib/python3.6/site-packages/django/apps/config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "/home/user/project/env/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/user/project/env/lib/python3.6/site-packages/django_celery_beat/models.py", line 6, in <module>
    import timezone_field
  File "/home/user/project/env/lib/python3.6/site-packages/timezone_field/__init__.py", line 1, in <module>
    from timezone_field.fields import TimeZoneField
  File "/home/user/project/env/lib/python3.6/site-packages/timezone_field/fields.py", line 5, in <module>
    from django.utils import six
ImportError: cannot import name 'six'

we will release v2 of the project with django 2.2+3 support and dropping python 2

Any workaround for now?

timezone_field error has been fixed

When will v2 be released?

Also interested in this Issue's resolution.

also interested! :)

Found a workaround
add django-timezone-field to requirements.txt and do a pip install -r requirements.txt --upgrade
Error went away after that.

The problem is, django-celery-beat 1.6.0 requires django-timezone-field<4.0 which is incompatible with django3.

When I do pip install -U django-celery-beat, I get django-celery-beat 1.6.0 and django-timezone-field 3.1
When I do pip install -U django-timezone-field I get 4.0 but it says django-celery beat requires django-timezone-field<4.0

django-celery-beat requires django-timezone-field<4.0 to support Django 1.11 since django-timezone-field>4 does not support Django 1.11.

Is it safe to use django-celery-beat==1.6.0 with Django 2.2?

Only workaround I found was revert to Django 2.2. Using docker compose, so modifying files ect would have been a mess

@auvipy I think this issue can be closed now

Thanks @D3X I just bumped into this one today when my packages updated.

Hmm, I still receive this error, even if I'm not specifying any package versions (should take the latest by default). Adding the django-timezone-field package to requirements.txt helped.

Was this page helpful?
0 / 5 - 0 ratings