Solveddjango celery beat Not compatible with celery 5.0.0


When go to admin periodictask page, these is an error.

  • Celery Version: 5.0.0
  • Celery-Beat Version: 2.0.0

Exact steps to reproduce the issue:

  1. Login to admin page
  2. Click Periodic tasks
  3. Boom

Detailed information



Request Method: GET
Request URL: http://localhost:8000/admin/django_celery_beat/periodictask/

Django Version: 3.1.1
Python Version: 3.8.5
Installed Applications:
Installed Middleware:

Traceback (most recent call last):
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django\core\handlers\", line 47, in inner
response = get_response(request)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django\core\handlers\", line 179, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django\contrib\admin\", line 614, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django\utils\", line 130, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django\views\decorators\", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django\contrib\admin\", line 233, in inner
return view(request, *args, **kwargs)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django_celery_beat\", line 156, in changelist_view
extra_context['wrong_scheduler'] = not is_database_scheduler(scheduler)
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django_celery_beat\", line 42, in is_database_scheduler
from .schedulers import DatabaseScheduler
File "C:\Users\hmy01\Works\Working\smart-home.venv\lib\site-packages\django_celery_beat\", line 11, in
from celery.utils.encoding import safe_str, safe_repr

Exception Type: ModuleNotFoundError at /admin/django_celery_beat/periodictask/
Exception Value: No module named 'celery.utils.encoding'

17 Answers

✔️Accepted Answer

if you need a quick local fix, you can monkey patch it in a high level init module:

import sys
from kombu.utils import encoding
sys.modules['celery.utils.encoding'] = encoding

Other Answers:

v2.1.0 is now on pypi

v2.1.0 works with Celery v5.0.0 in my setup the issue is resolved and can be closed.

Related Issues:

django celery beat Not compatible with celery 5.0.0
if you need a quick local fix you can monkey patch it in a high level init module: ...
django celery beat Django Celery Beat admin updating Cron Schedule Periodic task not taking effect?
Same issue as OP after save in admin the beat process outputs DatabaseScheduler: Schedule changed bu...
cookiecutter django No support for python3? I am getting: invalid syntax: raise ValueError, "No frame marked with %s." % fname
For me the issue was that I installed the environ package instead of the django-environ package. ...
kombu Table empty or key no longer exists
faced this same issue on the first queue whenever i started a second or more queues fixed by downgra...
cookiecutter django Invalid HTTP_HOST header: <ip>. You may need to add <ip> to ALLOWED_HOSTS.
@piyushmaurya23 if you do set ALLOWED_HOSTS = ['*'] for the love of God don't leave it as such once ...
cookiecutter django docker/celery exits because celery is run as root
It's only running locally where it's a problem In my dev.yml I added C_FORCE_ROOT to the environment...
Zappa bad magic number in 'application': b'\x03\xf3\r\n': ImportError
I was able to fix this too by doing find -name \*.pyc -delete Mine definitely wasn't caused by PY2 -...
Zappa AttributeError: 'module' has no attribute 'get_installed_distributions'
You probably have a newer pip they made changes to their public api top level functions recently Try...
graphene django Bypass csrf
Hi @nlhkh! You can do something like: I have the use case of a mobile client app accessing graphql r...
sentry sentry 9 clean install - Oops! Something went wrong
Well we can try to do something here :) Run sentry shell which will give you a python REPL within Se...
graphene django Is it possible to get the headers from the request?
@Oxyrus you can access request and its headers by using context field from info parameter in your re...
graphene django Is totalCount not implemented on Relay?
This is how to do it in version 2 (graphene is woefully undocumented) :( This gives me an error in /...
djongo int() argument must be a string, a bytes-like object or a number, not 'ObjectId'
Hello @Rockflo and @raghava-k2; Basically under the hood Well I may have missed something there (dja...
djongo Cannot correctly set primary key
Fix for the issue with error similar to the one given below : Hey @ngdcminhuet I too faced this issu...
graphene django Different types with the same name in the schema - Django fields with choices
It seems you're not allowed to include type in your field's name Hi ...
django webpack loader render_bundle failing with TypeError: string indices must be integers
@owais please note that installing the npm package as per README results in a package.json that incl...
sentry [ERROR] celery.worker.job: Task[c092365d-609b-454a-a66f-2b7039fb44d8] raised unexpected
Well I fixed this problem it is not easy I build sentry and run it with docker and i can create my p...
djongo Having trouble connecting to MongoDB Atlas
pip install djongo pip install dnspython in DATABASES = { 'default': { 'ENGINE': 'djongo...
factory_boy ImportError: The fake-factory package is now called Faker.
Just fixed with 2.8.1 — I had to upload a couple of versions to fix an issue with recent setuptools ...
awx Error with pip-docker (3.0.1): "Error connecting: load_config() got an unexpected keyword argument 'config_dict'"
For me even installing docker 3.1.3 resulted in errors What I had to do was: And the error stopped. ...
sentry Slack Integration: Inability to connect private channel
Thanks for the report! We added support for reporting to private channels just yesterday 18ae499 Bec...
awx Playbook fails when ssh host key changes
Giant pain in Ansible Tower Anytime an IP is recycled we've got manually clear it from the known_hos...
Zappa Error loading psycopg2 module on Python 3.6 (when on Lambda)
I solved the issue by installing psycopg2-binary Context Shiny new Zappa 0.41 and Python 3.6 Django=...
awx Provide custom CA certificate or skip-verify option for LDAP auth
I'm just passing following env var to awxweb container: env: LDAPTLS_REQCERT: never ...
django storages GS_CREDENTIALS clarification
We found another way Instead of doing this do this I've downloaded the service account json file and...
weblate weblate & icu format
Hello I've been looking at using Weblate for the FrankerFaceZ project (browser extension for Twitch)...
graphene django How to extend connection info?
I made the code reusable IMHO But it is not a beautiful. Hi ...
pretix don't use flags to indicate languages
Just a word of appreciation and gratitude for the welcoming gesture Hi please don't spread the bad h...
wagtail Latest code throws 'unexpected keyword argument parent_page' in django-modelcluster
Funny that we all encounter the same problem within minutes I have the same problem I have a working...
django blog zinnia Zinnia0.18, in Python3 venv, DEBUG on, Cannot resolve keyword 'entries' into field. Choices are:avatar, comment_comments,...
I don't understand what's going under the hood but here is what I have found When DEBUG is True ...
sentry sentry-cli releases set-commits --auto not working -> trying to match repo url https to ssh
@petterhoel Have you considered re-adding the origin remote to the clone that netlify made? @marksto...
Zappa Error when deploying AWS Lambda with Zappa package
I seems that causes the problem: release 3.0.0 does not instal...
awx Web Service not working due to missing instance for the host
I found the root cause of the problem lies between the file awx/installer/roles/image_build/files/la...
django rest framework django rest filter working but browsable api not showing filter forms
@xordoquy Isn't this a real issue? I have been facing the same problem from v3.5.4 to v3.6.2 ...
django oauth toolkit Grant type client_credentials not working with Django 1.11
I think it might be better to override the OAuth2Authentication class and pull out the application u...
saleor Error build-assets - new decorators proposal is not supported yet. You must pass the"legacy": true option
I solved this error changing the two lines below at package.json I don't know if this is the best so...
keras Loading model with custom loss function: ValueError: 'Unknown loss function'
I solved this problem by adding 'custom_bojects' my loss function: I trained and saved a model that ...
scrapy ' error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 '
@euler16 for scrapy with Python 3 you'll need with Python 2 you'll need I wanted to install scrapy i...
keras Tensorflow backend - bug in model._make_predict_function(...)
I had this problem when doing inference in a different thread than where I loaded my model ...
mysqlclient Can't install mysqlclient on MacOS
You can set ssl library path explicitly. Hi I'm on MacOSX Sierra ...
keras Creating Model variable throws "AttributeError: 'Tensor' object has no attribute '_keras_history'"
@zaid478 oh I assumed you were doing it on coursera Anyway Hello all setup: Keras 2.0 Tensorflow 1.0...
tensorflow ImportError: cannot open shared object file: No such file or directory
@rhinsall I just found this out myself not sure if it's common knowledge but got around this by doin...
ipython Last jedi release (0.18.0) is incompatible with ipython (7.19 and 7.18 tested); reason - column arg was deprecated, and now removed
As a temporary fix for anyone just trying to get things working again: It would be really nice if yo...
pyodbc pip install pyodbc failing: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
src/pyodbc.h:56:17: fatal error: sql.h: No such file or directory #include <sql.h> ^ Your machine do...
keras "<tensor> is not an element of this graph." when loading model.
I had a problem similar to that of @piraka9011 which was solved by calling model._make_predict_funct...
psycopg2 psycopg2-binary fails to install on macOS Big Sur 11.0.1 and Python 3.9.0 (with possible workaround)
Actually figured it out Haven't worked on a Mac in a while and forgot about the PostgreSQL dependenc...
pytorch I can't import PyTorch, libomp.dylib can't be loaded.
brew install libomp solves the problem. 🐛 Bug I tried to install PyTorch but I can't use it ...
pytorch RuntimeError: cuda runtime error (59) : device-side assert triggered when running transfer_learning_tutorial
@soumith Hi I find the error it is due to my labels contain value -1 which is unacceptable in criter...
tensorflow At Runtime : "Error while reading resource variable softmax/kernel from Container: localhost"
I had the same issue in tensorflow 1.13.1 which I have resolved by creating a reference to the sessi...