ImportError: cannot import name parse_lookup

Asked by Willian Kis on 2012-04-05

Hello

I'm trying to implement the Graphite on our servers and when i try to do a syn_db i have this error message:
ImportError: cannot import name parse_lookup

here is the full tarck

root@debian:/opt/graphite/webapp/graphite# python manage.py syncdb
/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
  "use STATIC_URL instead.", DeprecationWarning)
/usr/local/lib/python2.6/dist-packages/django/core/cache/__init__.py:73: DeprecationWarning: settings.CACHE_* is deprecated; use settings.CACHES instead.
  DeprecationWarning
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 458, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 381, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 230, in execute
    self.validate()
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 266, in validate
    num_errors = get_validation_errors(s, app)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/validation.py", line 30, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/loading.py", line 158, in get_app_errors
    self._populate()
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/loading.py", line 67, in _populate
    self.load_app(app_name)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/loading.py", line 88, in load_app
    models = import_module('.models', app_name)
  File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/graphite/webapp/graphite/events/models.py", line 10, in <module>
    from tagging.fields import TagField
  File "/usr/local/lib/python2.6/dist-packages/tagging-0.2.1-py2.6.egg/tagging/fields.py", line 10, in <module>
    from tagging.models import Tag
  File "/usr/local/lib/python2.6/dist-packages/tagging-0.2.1-py2.6.egg/tagging/models.py", line 9, in <module>
    from tagging.managers import TagManager, TaggedItemManager
  File "/usr/local/lib/python2.6/dist-packages/tagging-0.2.1-py2.6.egg/tagging/managers.py", line 6, in <module>
    from django.db.models.query import QuerySet, parse_lookup
ImportError: cannot import name parse_lookup

I'm using python 2.6.6 and Django 1.5 with a MySQL database.
I changed the version of Django and Python but still recieve this error message when i do a Sync DB =(

Thanks for the help and sorry for my poor english =P

Regards

Question information

Language:
English Edit question
Status:
Answered
For:
Graphite Edit question
Assignee:
No assignee Edit question
Last query:
2012-04-05
Last reply:
2013-01-07
Michael Leinartas (mleinartas) said : #1

I believe the error is due to the django-tagging package missing. Even so, Django 1.4 was just released two weeks ago and Graphite hasn't yet made the changes yet to be compatible with it (see https://bugs.launchpad.net/graphite/+bug/963684) so I'd suggest starting with Django 1.3 as you'll run into other issues otherwise.

Zippy Zeppoli (zippyzeppoli) said : #2

I have django-tagging present, and I reverted to 1.3 but I still have this problem:
python manage.py syncdb
/root/pysuk/lib/python2.6/site-packages/django/db/__init__.py:19: DeprecationWarning: settings.DATABASE_* is deprecated; use settings.DATABASES instead.
  DeprecationWarning
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/root/pysuk/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/root/pysuk/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/root/pysuk/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/root/pysuk/lib/python2.6/site-packages/django/core/management/base.py", line 219, in execute
    self.validate()
  File "/root/pysuk/lib/python2.6/site-packages/django/core/management/base.py", line 249, in validate
    num_errors = get_validation_errors(s, app)
  File "/root/pysuk/lib/python2.6/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/root/pysuk/lib/python2.6/site-packages/django/db/models/loading.py", line 146, in get_app_errors
    self._populate()
  File "/root/pysuk/lib/python2.6/site-packages/django/db/models/loading.py", line 64, in _populate
    self.load_app(app_name)
  File "/root/pysuk/lib/python2.6/site-packages/django/db/models/loading.py", line 78, in load_app
    models = import_module('.models', app_name)
  File "/root/pysuk/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/graphite/webapp/graphite/events/models.py", line 6, in <module>
    from tagging.managers import ModelTaggedItemManager
  File "/root/pysuk/lib/python2.6/site-packages/tagging-0.2.1-py2.6.egg/tagging/managers.py", line 6, in <module>
    from django.db.models.query import QuerySet, parse_lookup
ImportError: cannot import name parse_lookup

Steve (steve-ni) said : #3

I also reverted from Django 1.4.3 to 1.3.5 and get the same error:

...
from django.db.models.query import QuerySet, parse_lookup
ImportError: cannot import name parse_lookup

rowan (rowanu) said : #4

Do you have django-tagging installed?

You can see what python packages you have installed with "pip freeze". You
should see something like:

...
django-tagging==0.3.1
...

On Mon, Jan 07, 2013 at 04:45 PM, Steve <email address hidden> wrote:

> from: Steve <email address hidden>
> date: Mon, Jan 07 09:45 PM +00:00 2013
> to: <email address hidden>
> reply-to: <email address hidden>
> subject: Re: [Graphite-dev] [Question #192727]: ImportError: cannot import name parse_lookup
>
> Question #192727 on Graphite changed:
> https://answers.launchpad.net/graphite/+question/192727
>
> Steve posted a new comment:
> I also reverted from Django 1.4.3 to 1.3.5 and get the same error:
>
> ...
> from django.db.models.query import QuerySet, parse_lookup
> ImportError: cannot import name parse_lookup
>
> --
> You received this question notification because you are a member of
> graphite-dev, which is an answer contact for Graphite.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~graphite-dev
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~graphite-dev
> More help : https://help.launchpad.net/ListHelp

Rowan

Steve (steve-ni) said : #5

Hi rowan, I do have tagging installed:

# pip freeze |grep tagging
tagging==0.2.1

# pip install tagging --upgrade
Requirement already up-to-date: tagging in /usr/lib/python2.6/site-packages

Steve

Can you help with this problem?

Provide an answer of your own, or ask Willian Kis for more information if necessary.

To post a message you must log in.