2016-11-11 89 views
10

我試圖按照教程安裝django芹菜。安裝後,我需要運行遷移進行必要的表,但似乎是錯誤:ImportError:沒有名爲timeutils的模塊

Traceback (most recent call last): 
    File "manage.py", line 10, in <module> 
    execute_from_command_line(sys.argv) 
    File "/home/guilherme/.virtualenvs/martizi-api/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line 
    utility.execute() 
    File "/home/guilherme/.virtualenvs/martizi-api/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 327, in execute 
    django.setup() 
    File "/home/guilherme/.virtualenvs/martizi-api/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup 
    apps.populate(settings.INSTALLED_APPS) 
    File "/home/guilherme/.virtualenvs/martizi-api/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate 
    app_config.import_models(all_models) 
    File "/home/guilherme/.virtualenvs/martizi-api/local/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models 
    self.models_module = import_module(models_module_name) 
    File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module 
    __import__(name) 
    File "/home/guilherme/.virtualenvs/martizi-api/local/lib/python2.7/site-packages/djcelery/models.py", line 15, in <module> 
    from celery.utils.timeutils import timedelta_seconds 
ImportError: No module named timeutils 

IM沒有找到這事在網上timeutils使用

IM:

Django的== 1.9.8 django-celery == 3.1.17

謝謝!

+0

也許這是這個包:https://pypi.python.org/pypi/cs.timeutils? – Marcin

+1

看到這個問題:https://github.com/celery/django-celery/issues/491。如果你使用的是celery 4.0,這很可能是問題,因爲django-celery不支持這個版本。 – elethan

+0

對,即時通訊使用芹菜4.0 ...即時通訊困惑,所以我不能使用django芹菜?當我安裝pip軟件包django-celery默認安裝芹菜4.0 我怎麼說pip安裝django-celery設置了以前版本的芹菜? 在這種情況下,我做了什麼? tks @elethan –

回答

29

看來django-celery==3.1.17不適用於更新版本的celery(請參閱this github issue)。

如果您可以使用早期版本的celery,則可以卸載當前版本,安裝特定的舊版本,並且django-celery應該再次運行。例如:

$ pip uninstall celery 
$ pip install celery==3.1 

應該得到的東西再工作,直到django-celery支持celery新版本。

相關問題