好吧,我已经尝试了我和谷歌能想到的一切。我正在尝试在 Macbook Pro OSX 10.8.4 上的 virtualenv 下运行 django-celery。我在激活 virtualenv 时使用 pip 安装了 django-celery 。在 virtualenv python 中导入 djcelery 时,我得到以下信息。
(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 freeze 包的列表。
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
任何帮助将不胜感激!!
所以 djcelery 和我的项目文件夹中的某些内容似乎存在冲突。
我使用的文件夹结构是这样的
\-project
--manage.py
--requirements.txt
\---platform
----app1
----app2
----etc
似乎平台文件夹与导入中的某些内容发生冲突,一旦我更改了此设置,导入就开始正常运行。
感谢所有的帮助和评论。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)