3

When I try to run my celery workers for my django application, I get an import error.

As far as I can tell it's an import in kombu.utils failing

What follows is a rather large stack-trace:

$ ./manage.py celery worker --loglevel=info
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/djcelery/management/commands/celery.py", line 22, in run_from_argv
    ["%s %s" % (argv[0], argv[1])] + argv[2:])
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 890, in execute_from_commandline
    super(CeleryCommand, self).execute_from_commandline(argv)))
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 179, in execute_from_commandline
    return self.handle_argv(prog_name, argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 882, in handle_argv
    return self.execute(command, argv)
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 857, in execute
    return cls(app=self.app).run_from_argv(self.prog_name, argv)
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 142, in run_from_argv
    return self(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 112, in __call__
    ret = self.run(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 214, in run
    return self.target.run(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/bin/celeryd.py", line 153, in run
    return self.app.Worker(**kwargs).run()
  File "/usr/local/lib/python2.7/dist-packages/celery/apps/worker.py", line 176, in run
    print(str(self.colored.cyan(' \n', self.startup_info())) +
  File "/usr/local/lib/python2.7/dist-packages/celery/apps/worker.py", line 246, in startup_info
    'conninfo': self.app.connection().as_uri(),
  File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 446, in as_uri
    fields = self.info()
  File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 435, in info
    return OrderedDict(self._info())
  File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 414, in _info
    D = self.transport.default_connection_params
  File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 637, in transport
    self._transport = self.create_transport()
  File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 395, in create_transport
    return self.get_transport_cls()(client=self)
  File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 402, in get_transport_cls
    transport_cls = get_transport_cls(transport_cls)
  File "/usr/local/lib/python2.7/dist-packages/kombu/transport/__init__.py", line 104, in get_transport_cls
    _transport_cache[transport] = resolve_transport(transport)
  File "/usr/local/lib/python2.7/dist-packages/kombu/transport/__init__.py", line 88, in resolve_transport
    return symbol_by_name(transport)
  File "/usr/local/lib/python2.7/dist-packages/kombu/utils/__init__.py", line 81, in symbol_by_name
    module = imp(module_name, package=package, **kwargs)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: Import by filename is not supported.
2
  • ¿Can you post your Celery settings? Commented Oct 20, 2012 at 16:17
  • 1
    You probably set some setting that expected a module to the actual filename, such as using module/foo.py instead of module.foo. Commented Oct 20, 2012 at 16:19

1 Answer 1

5

Ah found the answer, I was using CELERY_RESULT_BACKEND = someUrl rather than "redis" etc

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.