简体   繁体   English

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

[英]Can't run a specific django project in a virtualenv

I need to edit but first run this project: https://pagure.io/fedora-commops/fedora-happiness-packets and it gives me errors even though I followed the instructions. 我需要编辑,但首先运行此项目: https : //pagure.io/fedora-commops/fedora-happiness-packets ,即使我按照说明进行操作,也会给我带来错误。

First I forked the repo, then cloned it to my computer and I followed the instructions listed in the setup section of the README.md file. 首先,我分叉了存储库,然后将其克隆到我的计算机上,然后按照README.md文件的“设置”部分中列出的说明进行操作。 When I run the command ./manage.py collectstatic I get this error: 当我运行命令./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

I tried importing celery but that method didn't work and I don't want to mess with the project. 我尝试导入芹菜,但是该方法不起作用,我也不想弄混这个项目。

Looking at issue 49 , it looks like celery is a dependency but it isn not listed in the requirements. 查看问题49 ,似乎celery是一个依赖项,但未在需求中列出。 Until that is fixed, you'll have to install it manually. 在修复该问题之前,您必须手动安装它。

pip install celery

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM