好吧,所以我已经尝试了所有我和谷歌可以上来。我试图在我的Macbook Pro OSX 10.8.4上的virtualenv下运行django-celery。当virtualenv被激活时,我使用pip安装了django-celery。在virtualenv python中导入djcelery时,我得到以下内容。Django:djcelery从芹菜导入current_app导入错误作为芹菜在virtualenv
(platform)Chriss-MacBook-Pro:platform Chris$ python
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import djcelery
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/Chris/Development/platform/lib/python2.7/site-packages/djcelery/__init__.py", line 25, in <module>
from celery import current_app as celery # noqa
ImportError: cannot import name current_app
我试图开始一个完全干净的virtualenv,但仍似乎得到相同的错误。我已经尝试升级模块并拥有。
这里也是我的pip冻结包的列表。
BeautifulSoup==3.2.1
Django==1.5
MySQL-python==1.2.4c1
PIL==1.1.7
Pillow==2.0.0
amqp==1.0.12
anyjson==0.3.3
billiard==2.7.3.30
boto==2.9.6
celery==3.0.20
certifi==0.0.8
chardet==2.1.1
django-activelink==0.3
django-activity-stream==0.4.4
django-appconf==0.6
django-celery==3.0.17
django-compressor==1.2
django-debug-toolbar==0.9.4
django-flag==0.1.1
django-guardian==1.1.1
django-ses==0.4.1
django-tinymce==1.5.1
django-userena==1.2.0
easy-thumbnails==1.2
html5lib==1.0b1
jsonfield==0.9.13
kombu==2.5.12
oauthlib==0.1.3
pisa==3.0.33
pyPdf==1.13
pyasn1==0.1.7
python-dateutil==2.1
python-memcached==1.53
pytz==2013b
reportlab==2.7
requests==0.13.1
requests-oauth==0.4.1
rsa==3.1.1
six==1.3.0
vimeo-wrapper==0.0.2
wsgiref==0.1.2
任何帮助将不胜感激!
你确定current_app是在芹菜模块中定义的吗? – ElmoVanKielmo
嗯,这是我从盒子里拿出来的。我应该在哪里定义它?我没有在芹菜的第一步看到任何东西 - http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html#configuring-your-django-project-to-use-芹菜关于定义它,所以我会认为它应该工作。 –
好吧,我设法弄清楚,如果我在我的项目文件夹之外,导入djcelery可以工作,但在文件夹内部时仍然无法工作。我不确定这是如何导致问题的,因为没有任何内容会改变项目文件夹中的环境。 –