我确信我已经用pip install celery
安装了celepie。我正在Docker上运行我的Django应用程序。当我运行命令docker compose up
时,它显示了错误。
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
batch_email-web-1 | File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
batch_email-web-1 | File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
batch_email-web-1 | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
batch_email-web-1 | File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
batch_email-web-1 | File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
batch_email-web-1 | File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
batch_email-web-1 | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
batch_email-web-1 | File "<frozen importlib._bootstrap_external>", line 940, in exec_module
batch_email-web-1 | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
batch_email-web-1 | File "/Batch_Email/Batch_Email/__init__.py", line 1, in <module>
batch_email-web-1 | from .celery import app as celery_app
batch_email-web-1 | File "/Batch_Email/Batch_Email/celery.py", line 4, in <module>
batch_email-web-1 | from celery import Celery
batch_email-web-1 | ModuleNotFoundError: No module named 'celery'
在安装celery之前,命令docker compose up
会运行Django服务器。我已经安装了使用celery的Redis。为什么我会收到这个错误,我该如何修复它?
1条答案
按热度按时间n3ipq98p1#
您正在使用名为
celery
的文件,该文件与名为celery
的软件包类似。请将本地文件重命名为类似celery_helper.py
的名称或与软件包名称不同的名称。