Errors with importing eav-django

76 views
Skip to first unread message

Jeremy Rottman

unread,
Dec 7, 2011, 12:32:34 AM12/7/11
to eav-django
I have installed eav-django into my dev environment and I am having
some issues with trying to get it imported into my application.

I have verified that eav-django is correctly installed to /usr/local/
lib/python2.7/dist-packages
This is the Traceback I am seeing:

Traceback (most recent call last):
File "/home/rottmanj/workspace/fiobox_redux/fiobox_redux/manage.py",
line 14, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/
__init__.py", line 438, in execute_manager
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/
__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/
base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/
base.py", line 219, in execute
self.validate()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/
base.py", line 249, in validate
num_errors = get_validation_errors(s, app)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/
validation.py", line 35, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/usr/local/lib/python2.7/dist-packages/django/db/models/
loading.py", line 146, in get_app_errors
self._populate()
File "/usr/local/lib/python2.7/dist-packages/django/db/models/
loading.py", line 64, in _populate
self.load_app(app_name)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/
loading.py", line 78, in load_app
models = import_module('.models', app_name)
File "/usr/local/lib/python2.7/dist-packages/django/utils/
importlib.py", line 35, in import_module
__import__(name)
File "/home/rottmanj/workspace/fiobox_redux/fiobox_redux/
user_account/models.py", line 2, in <module>
from eav.models import BaseEntity, BaseSchema, BaseAttribute
ImportError: cannot import name BaseEntity
Finished "/home/rottmanj/workspace/fiobox_redux/fiobox_redux/manage.py
syncdb" execution.

This is the code that I am testing with:
from django.db import models
from eav.models import BaseEntity, BaseSchema, BaseAttribute

class Fruit(BaseEntity):
title = models.CharField(max_length=50)

class Schema(BaseSchema):
pass

class Attr(BaseAttribute):
schema = models.ForeignKey(Schema, related_name='attrs')


Andy Mikhaylenko

unread,
Dec 8, 2011, 11:04:43 AM12/8/11
to eav-d...@googlegroups.com
Hi Jeremy,

I think the problem is not in eav-django itself but in the way it is imported.
What happens if you "import eav" in the interactive Python shell?
Do you run your project under virtualenv?

Andy

Ken

unread,
Jan 22, 2014, 8:14:48 AM1/22/14
to eav-d...@googlegroups.com
Hi Andy,
I am also getting the same error even though I can successfully run 'import eav' in the python shell environment. I am running the commands from a virtual environment. What could be the problem?
Reply all
Reply to author
Forward
0 new messages