dimanche 11 octobre 2015

Celery Elastic Beanstalk ImportError: cannot import name Celery

I'm trying to get celery to work on Elastic Beanstalk through Django but not having much luck.

I'm able to use celery on my local machine, but whenever I deploy to Elastic Beanstalk, it doesn't like this line: from celery import Celery.

I looked at a few other questions about this and they said to change the name of my python file of celery.py to something like celeryapp.py but this doesn't change the result.

The error message in full is this:

  File "manage.py", line 10, in <module>
  execute_from_command_line(sys.argv)
  File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
  utility.execute()
  File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
  settings.INSTALLED_APPS
  File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
  self._setup(name)
  File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
  self._wrapped = Settings(settings_module)
  File "/opt/python/run/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
  mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
  __import__(name)
  File "/opt/python/bundle/3/app/MY_PROJECT/__init__.py", line 5, in <module>
  from .celery import app as celery_app
  File "/opt/python/bundle/3/app/MY_PROJECT/celery.py", line 5, in <module>
  from celery import Celery
  File "/opt/python/current/app/MY_PROJECT/celery.py", line 5, in <module>
  from celery import Celery
  ImportError: cannot import name Celery
   (ElasticBeanstalk::ExternalInvocationError)

Anyone got any idea why celery can't import Celery? In my requirements.txt I have celery==3.1.18, so I'm assuming the library is installed.




Aucun commentaire:

Enregistrer un commentaire