Django Daemonizing芹菜——没有名为';芹菜';错误

Django Daemonizing芹菜——没有名为';芹菜';错误,django,celery,django-celery,celeryd,daemons,Django,Celery,Django Celery,Celeryd,Daemons,我正试图在Ubuntu18上对芹菜4.3.0进行后台监控。这适用于Django项目,用于卸载密集型任务 当服务器运行芹菜服务时,芹菜工人应该可以处理任务。然而,Apache2甚至不会运行。如果我tail看到Apache日志: [Sun Sep 29 07:42:07.621273 2019] [wsgi:error] [pid 2648:tid 140134825535232] [remote 92.4.204.209:55952] File "<frozen importlib._b

我正试图在Ubuntu18上对芹菜4.3.0进行后台监控。这适用于Django项目,用于卸载密集型任务

当服务器运行芹菜服务时,芹菜工人应该可以处理任务。然而,Apache2甚至不会运行。如果我
tail
看到Apache日志:

[Sun Sep 29 07:42:07.621273 2019] [wsgi:error] [pid 2648:tid 140134825535232] [remote 92.4.204.209:55952]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[Sun Sep 29 07:42:07.621279 2019] [wsgi:error] [pid 2648:tid 140134825535232] [remote 92.4.204.209:55952]   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
[Sun Sep 29 07:42:07.621285 2019] [wsgi:error] [pid 2648:tid 140134825535232] [remote 92.4.204.209:55952]   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
[Sun Sep 29 07:42:07.621291 2019] [wsgi:error] [pid 2648:tid 140134825535232] [remote 92.4.204.209:55952]   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
[Sun Sep 29 07:42:07.621297 2019] [wsgi:error] [pid 2648:tid 140134825535232] [remote 92.4.204.209:55952]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[Sun Sep 29 07:42:07.621303 2019] [wsgi:error] [pid 2648:tid 140134825535232] [remote 92.4.204.209:55952]   File "/var/www/html/examgap/examgap/__init__.py", line 5, in <module>
[Sun Sep 29 07:42:07.621307 2019] [wsgi:error] [pid 2648:tid 140134825535232] [remote 92.4.204.209:55952]     from .celery import app as celery_app
[Sun Sep 29 07:42:07.621313 2019] [wsgi:error] [pid 2648:tid 140134825535232] [remote 92.4.204.209:55952]   File "/var/www/html/examgap/examgap/celery.py", line 5, in <module>
[Sun Sep 29 07:42:07.621317 2019] [wsgi:error] [pid 2648:tid 140134825535232] [remote 92.4.204.209:55952]     from celery import Celery
[Sun Sep 29 07:42:07.621333 2019] [wsgi:error] [pid 2648:tid 140134825535232] [remote 92.4.204.209:55952] ModuleNotFoundError: No module named 'celery'
提前谢谢

编辑:这也是我的
/etc/conf.d/芹菜:

# Name of nodes to start
# here we have a single node
CELERYD_NODES="eg1"
# or we could have three nodes:
#CELERYD_NODES="w1 w2 w3"

# Absolute or relative path to the 'celery' command:
#CELERY_BIN="/usr/local/bin/celery"
#CELERY_BIN="/virtualenvs/def/bin/celery"
#Think I installed Celery only for user ubuntu
CELERY_BIN="/home/ubuntu/.local/bin/celery"

#CELERYD_CHDIR="/var/www/html/examgap/"
# App instance to use
# comment out this line if you don't use an app
CELERY_APP="examgap"
# or fully qualified:
# CELERY_APP="examgap.tasks:app"

# How to call manage.py
CELERYD_MULTI="multi"

# Extra command-line arguments to the worker
CELERYD_OPTS="--time-limit=300 --concurrency=8"

# - %n will be replaced with the first part of the nodename.
# - %I will be replaced with the current child process index
#   and is important when using the prefork pool to avoid race conditions.
CELERYD_PID_FILE="/var/run/celery/%n.pid"
CELERYD_LOG_FILE="/var/log/celery/%n%I.log"
CELERYD_LOG_LEVEL="INFO"
编辑2:将WorkingDirectory更改为我的项目目录,现在芹菜服务正在运行。然而,模块查找错误:没有名为“芹菜”的模块仍然存在。

[Sun Sep 29 07:42:07.621313 2019][wsgi:error][pid 2648:tid 140134825535232][remote 92.4.204.209:55952]文件“/var/www/html/examgap/examgap/芹菜.py”,第5行,在
[Sun Sep 29 07:42:07.621313 2019] [wsgi:error] [pid 2648:tid 140134825535232] [remote 92.4.204.209:55952]   File "/var/www/html/examgap/examgap/celery.py", line 5, in <module>
似乎您有自己的芹菜.py,如果有,您应该重命名它以避免导入问题

[Sun Sep 29 07:42:07.621313 2019][wsgi:error][pid 2648:tid 140134825535232][remote 92.4.204.209:55952]文件“/var/www/html/examgap/examgap/celery.py”,第5行,in

似乎您有自己的芹菜.py,如果是这样,您应该重命名它以避免导入问题

这里我让一些链接看起来非常好。刚才我也在做同样的事情

  • (推荐)
  • (我认为这是一种巧妙的方式)
  • (职业级别)

  • 我希望这对你有用。

    在这里,我提供一些看起来非常棒的链接。刚才我也在做同样的事情

  • (推荐)
  • (我认为这是一种巧妙的方式)
  • (职业级别)
  • 我希望这对你有用

    [Sun Sep 29 07:42:07.621313 2019] [wsgi:error] [pid 2648:tid 140134825535232] [remote 92.4.204.209:55952]   File "/var/www/html/examgap/examgap/celery.py", line 5, in <module>