gpt4 book ai didi

python - 导入错误 : No module named timeutils

转载 作者:太空狗 更新时间:2023-10-29 17:53:39 25 4
gpt4 key购买 nike

我正在尝试按照 Django-celery 的安装教程进行操作。安装后,我需要运行 migrate 来制作必要的表,但是出现了这个错误:

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

我在 Internet 上找不到任何关于此“timeutils”的信息...我正在使用 Django 1.9.8 和 Django-celery 3.1.17。

请帮忙!

最佳答案

django-celery==3.1.17 似乎不适用于较新版本的 celery(参见 this github issue)。

如果您可以接受使用早期版本的 celery,您可以卸载当前版本,安装特定的旧版本,django-celery 应该可以工作再次。例如:

$ pip uninstall celery
$ pip install celery==3.1

django-celery 支持较新版本的 celery 之前应该可以恢复正常。

关于python - 导入错误 : No module named timeutils,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40540769/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com