无法在virtualenv中运行特定的Django项目

时间:2018-10-24 15:16:52

标签: python django virtualenv

我需要编辑,但首先运行以下项目:https://pagure.io/fedora-commops/fedora-happiness-packets,即使我按照说明进行操作,也会出现错误。

首先,我分叉了该存储库,然后将其克隆到我的计算机上,然后按照README.md文件的设置部分中列出的说明进行操作。当我运行命令./manage.py collectstatic时,出现此错误:

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/alexmarginean/Desktop/fed/fedora-happiness-packets/virtualenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
  File "/Users/alexmarginean/Desktop/fed/fedora-happiness-packets/virtualenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute
django.setup()
  File "/Users/alexmarginean/Desktop/fed/fedora-happiness-packets/virtualenv/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
  File "/Users/alexmarginean/Desktop/fed/fedora-happiness-packets/virtualenv/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
app_config.import_models()
  File "/Users/alexmarginean/Desktop/fed/fedora-happiness-packets/virtualenv/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
  File "/Users/alexmarginean/Desktop/fed/fedora-happiness-packets/happinesspackets/messaging/models.py", line 15, in <module>
from happinesspackets.tasks import send_html_mail
  File "/Users/alexmarginean/Desktop/fed/fedora-happiness-packets/happinesspackets/tasks.py", line 3, in <module>
from happinesspackets._celery import app
  File "/Users/alexmarginean/Desktop/fed/fedora-happiness-packets/happinesspackets/_celery.py", line 2, in <module>
from celery import Celery
ImportError: No module named celery

我尝试导入芹菜,但是这种方法不起作用,我也不想弄混这个项目。

2 个答案:

答案 0 :(得分:3)

issue 49看,celery似乎是一个依赖项,但未在需求中列出。在修复该问题之前,您必须手动安装它。

pip install celery

答案 1 :(得分:0)

您是否已在virtualenv中完成了pip install -r要求?