読者です 読者をやめる 読者になる 読者になる

celeryが原因でpython manage.py syncdbに失敗した時のメモ

Python

エラー。

$ python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/logosware/.pyenv/versions/mmr2/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/home/logosware/.pyenv/versions/mmr2/lib/python2.7/site-packages/django/core/management/__init__.py", line 328, in execute
    django.setup()
  File "/home/logosware/.pyenv/versions/mmr2/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/logosware/.pyenv/versions/mmr2/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/home/logosware/.pyenv/versions/mmr2/lib/python2.7/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/home/logosware/.pyenv/versions/2.7.12/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/logosware/.pyenv/versions/mmr2/lib/python2.7/site-packages/djcelery/models.py", line 15, in <module>
    from celery.utils.timeutils import timedelta_seconds
ImportError: No module named timeutils

http://stackoverflow.com/questions/40540769/importerror-no-module-named-timeutils

$ pip uninstall celery
$ pip install celery==3.1

stackoverflowのおかげですぐに解決。