Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ModuleNotFoundError-poetry/cookiecutter_Python_Django_Celery_Cookiecutter - Fatal编程技术网

Python ModuleNotFoundError-poetry/cookiecutter

Python ModuleNotFoundError-poetry/cookiecutter,python,django,celery,cookiecutter,Python,Django,Celery,Cookiecutter,我正在尝试通过诗歌运行命令,并不断出现以下错误: Traceback (most recent call last): File "manage.py", line 30, in <module> execute_from_command_line(sys.argv) File "/mnt/c/users/lisa/documents/github/pollsapi_w_template/.venv/lib/python3.8/site-

我正在尝试通过诗歌运行命令,并不断出现以下错误:

Traceback (most recent call last):
  File "manage.py", line 30, in <module>
    execute_from_command_line(sys.argv)
  File "/mnt/c/users/lisa/documents/github/pollsapi_w_template/.venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/mnt/c/users/lisa/documents/github/pollsapi_w_template/.venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 377, in execute
    django.setup()
  File "/mnt/c/users/lisa/documents/github/pollsapi_w_template/.venv/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/mnt/c/users/lisa/documents/github/pollsapi_w_template/.venv/lib/python3.8/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/mnt/c/users/lisa/documents/github/pollsapi_w_template/.venv/lib/python3.8/site-packages/django/apps/config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/mnt/c/users/lisa/documents/github/pollsapi_w_template/pollsapi_w_template/users/models.py", line 11, in <module>
    from pollsapi_w_template.users.emails import RestorePasswordEmail, VerificationEmail
  File "/mnt/c/users/lisa/documents/github/pollsapi_w_template/pollsapi_w_template/users/emails.py", line 3, in <module>
    from snitch.emails import TemplateEmailMessage
  File "/mnt/c/users/lisa/documents/github/pollsapi_w_template/.venv/lib/python3.8/site-packages/snitch/emails.py", line 11, in <module>
    from snitch.tasks import send_email_asynchronously
  File "/mnt/c/users/lisa/documents/github/pollsapi_w_template/.venv/lib/python3.8/site-packages/snitch/tasks.py", line 3, in <module>
    from celery.task import task
ModuleNotFoundError: No module named 'celery.task'

我解决了,这是一个版本错误:芹菜5.0似乎没有任务模块

我通过运行
poetry add解决了这个问题celery@4.4.0

RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
  "program uses threads.", RuntimeWarning)

Python 2.7 will no longer be supported in the next feature release of Poetry (1.2).You should consider updating your Python version to a supported one.

Note that you will still be able to manage Python 2.7 projects by using the env command.
See https://python-poetry.org/docs/managing-environments/ for more information.

Updating dependencies
Resolving dependencies... (1.9s)

Writing lock file

No dependencies to install or update