安装Django组织的关键错误

时间:2017-05-25 14:54:11

标签: python django

我正在尝试安装django-organization。我尝试使用pip并得到以下错误(使用Git包时出现相同的错误)。

我正在使用带有python 1.11和python 2.7的cloud 9平台。

非常感谢您的帮助

Traceback (most recent call last): File "manage.py", line 10, in <module> 
execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist-
packages/django/core/management/__init__.py", line 350, in 
execute_from_command_line utility.execute() File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 324, in execute django.setup() File "/usr/local/lib/python2.7/dist-
packages/django/__init__.py", line 18, in setup 
apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python2.7/dist-
packages/django/apps/registry.py", line 108, in populate 
app_config.import_models(all_models) File "/usr/local/lib/python2.7/dist-
packages/django/apps/config.py", line 202, in import_models 
self.models_module = import_module(models_module_name) File 
"/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module 
__import__(name) File "/usr/local/lib/python2.7/dist-
packages/organizations/models.py", line 26, in <module> from .abstract 
import (AbstractOrganization, File "/usr/local/lib/python2.7/dist-
packages/organizations/abstract.py", line 37, in <module> from .base import 
OrgMeta, AbstractBaseOrganization, AbstractBaseOrganizationUser, 
AbstractBaseOrganizationOwner File "/usr/local/lib/python2.7/dist-
packages/organizations/base.py", line 186, in <module> class 
OrganizationBase(six.with_metaclass(OrgMeta, AbstractBaseOrganization)): 
File "/usr/lib/python2.7/dist-packages/six.py", line 617, in with_metaclass 
return meta("NewBase", bases, {}) File "/usr/local/lib/python2.7/dist-
packages/organizations/base.py", line 74, in __new__ return super(OrgMeta, 
cls).__new__(cls, name, bases, attrs) File "/usr/local/lib/python2.7/dist-
packages/django/db/models/base.py", line 81, in __new__ module = 
attrs.pop('__module__') KeyError: u'__module__'

1 个答案:

答案 0 :(得分:0)

在一个类似的问题(this)中,问题似乎是Python的six。试试这个:

pip-2.7 install --upgrade six