title: django celery error: Unrecoverable error: AttributeError("'EntryPoint' object has no attribute 'module_name'")
body: <p>I am perplexed,from a weird error which i have no idea as i am new to celery, this error occurs on just the setup phase, every thing is simply configured as written in the celery doc <a href="https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html" rel="noreferrer">https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html</a>
  the tracback is:</p>
  <pre><code>(env) muhammad@huzaifa:~/Desktop/practice/app$ celery -A app worker -l INFO
  [2022-04-04 16:21:40,988: WARNING/MainProcess] No hostname was supplied. Reverting to default 'localhost'
  [2022-04-04 16:21:40,993: CRITICAL/MainProcess] Unrecoverable error: AttributeError(&quot;'EntryPoint' object has no attribute 'module_name'&quot;)
  Traceback (most recent call last):
    File &quot;/home/muhammad/Desktop/practice/env/lib/python3.8/site-packages/celery/app/base.py&quot;, line 1250, in backend
      return self._local.backend
  AttributeError: '_thread._local' object has no attribute 'backend'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;/home/muhammad/Desktop/practice/env/lib/python3.8/site-packages/celery/worker/worker.py&quot;, line 203, in start
      self.blueprint.start(self)
    File &quot;/home/muhammad/Desktop/practice/env/lib/python3.8/site-packages/celery/bootsteps.py&quot;, line 112, in start
      self.on_start()
    File &quot;/home/muhammad/Desktop/practice/env/lib/python3.8/site-packages/celery/apps/worker.py&quot;, line 136, in on_start
      self.emit_banner()
    File &quot;/home/muhammad/Desktop/practice/env/lib/python3.8/site-packages/celery/apps/worker.py&quot;, line 170, in emit_banner
      ' \n', self.startup_info(artlines=not use_image))),
    File &quot;/home/muhammad/Desktop/practice/env/lib/python3.8/site-packages/celery/apps/worker.py&quot;, line 232, in startup_info
      results=self.app.backend.as_uri(),
    File &quot;/home/muhammad/Desktop/practice/env/lib/python3.8/site-packages/celery/app/base.py&quot;, line 1252, in backend
      self._local.backend = new_backend = self._get_backend()
    File &quot;/home/muhammad/Desktop/practice/env/lib/python3.8/site-packages/celery/app/base.py&quot;, line 955, in _get_backend
      backend, url = backends.by_url(
    File &quot;/home/muhammad/Desktop/practice/env/lib/python3.8/site-packages/celery/app/backends.py&quot;, line 69, in by_url
      return by_name(backend, loader), url
    File &quot;/home/muhammad/Desktop/practice/env/lib/python3.8/site-packages/celery/app/backends.py&quot;, line 47, in by_name
      aliases.update(load_extension_class_names(extension_namespace))
    File &quot;/home/muhammad/Desktop/practice/env/lib/python3.8/site-packages/celery/utils/imports.py&quot;, line 146, in load_extension_class_names
      yield ep.name, ':'.join([ep.module_name, ep.attrs[0]])
  AttributeError: 'EntryPoint' object has no attribute 'module_name'
  </code></pre>
  <p>the init file is:</p>
  <pre><code>from __future__ import absolute_import, unicode_literals
  
  from .celery import app as celery_app
  
  __all__ = ('celery_app',)
  </code></pre>
  <p>celery.py:</p>
  <pre><code>import os
  
  from celery import Celery
  
  # Set the default Django settings module for the 'celery' program.
  os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
  
  app = Celery('app', broker='localhost')
  
  # Using a string here means the worker doesn't have to serialize
  # the configuration object to child processes.
  # - namespace='CELERY' means all celery-related configuration keys
  #   should have a `CELERY_` prefix.
  app.config_from_object('django.conf:settings', namespace='CELERY')
  
  # Load task modules from all registered Django apps.
  app.autodiscover_tasks()
  
  
  @app.task(bind=True)
  def debug_task(self):
      print(f'Request: {self.request!r}')
  </code></pre>
  <p>For your information, rabbitmq-server is running on localhost thats why i have set BROKER_URL TO 'localhost'</p>
  <pre><code> rabbitmq-server.service - RabbitMQ Messaging Server
       Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
       Active: active (running) since Sun 2022-04-03 16:14:04 PKT; 24h ago
     Main PID: 1005 (beam.smp)
       Status: &quot;Initialized&quot;
        Tasks: 91 (limit: 9090)
  </code></pre>
  <p>idk why this is happening, i have been look around for like hours and cant find a solution and not even the error on google or anywhere.
  any help would be greatly appreciated
  Thanks!</p>