python – How do I start Celery correctly? I get TypeError: 'TaskRegistry' object is not callable


Hello! I am just mastering the web after switching from the desktop. It is necessary to implement background execution of tasks, for which I chose Celery. The project itself is on the Django framework, but for now I want to try purely Celery.

What I did: – installed celery in virtual environment – installed rabbitmq – created a separate folder in which the and file

Content of

from celery import Celery
app = Celery('tasks', backend='amqp', broker='amqp://')
def print_hello():
print ("Hello")

The content of (what I found on the Internet, like configs)

from __future__ import absolute_import, unicode_literals
from celery import Celery
app = Celery('proj',
# Optional configuration, see the application user guide.
if __name__ == '__main__':

I run it like this: (ENV) root @ cs53546: / home / analytics / messages # celery worker -A tasks

I get this:

Traceback (most recent call last):
File "/home/analytics/ENV/bin/celery", line 11, in 
File "/home/analytics/ENV/lib/python3.5/site-packages/celery/", line 14, in main
File "/home/analytics/ENV/lib/python3.5/site-packages/celery/bin/", line 326, in main
File "/home/analytics/ENV/lib/python3.5/site-packages/celery/bin/", line 488, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "/home/analytics/ENV/lib/python3.5/site-packages/celery/bin/", line 276, in execute_from_commandline
argv = self.setup_app_from_commandline(argv)
File "/home/analytics/ENV/lib/python3.5/site-packages/celery/bin/", line 478, in setup_app_from_commandline = self.find_app(app)
File "/home/analytics/ENV/lib/python3.5/site-packages/celery/bin/", line 500, in find_app
return find_app(app, symbol_by_name=self.symbol_by_name)
File "/home/analytics/ENV/lib/python3.5/site-packages/celery/app/", line 345, in find_app
sym = symbol_by_name(app, imp=imp)
File "/home/analytics/ENV/lib/python3.5/site-packages/celery/bin/", line 503, in symbol_by_name
return imports.symbol_by_name(name, imp=imp)
File "/home/analytics/ENV/lib/python3.5/site-packages/kombu/utils/", line 56, in symbol_by_name
module = imp(module_name, package=package, **kwargs)
File "/home/analytics/ENV/lib/python3.5/site-packages/celery/utils/", line 101, in import_from_cwd
return imp(module, package=package)
File "/home/analytics/ENV/lib/python3.5/importlib/", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 673, in _load_unlocked
File "", line 665, in exec_module
File "", line 222, in _call_with_frames_removed
File "/home/analytics/messages/", line 5, in 
TypeError: 'TaskRegistry' object is not callable

Question: What am I doing wrong?


Use @app.task instead of @app.tasks .

Scroll to Top