2

Very basic django app that gives me the following when I try to do anything (runserver, syncdb). Thoughts?

If it is a problem with one of my files, could you help guide me as to what the issue may be?

File "/Library/Python/2.7/site-packages/django/dispatch/__init__.py", line 9, in <module>
    from django.dispatch.dispatcher import Signal, receiver
ImportError: cannot import name receiver
Chris
  • 11,819
  • 19
  • 91
  • 145
  • possible duplicate of [Problem with Django-1.3 beta](http://stackoverflow.com/questions/4883802/problem-with-django-1-3-beta) - disregard the version number; in general this error occurs when you installed multiple versions of Django. – Amber Oct 08 '11 at 22:31
  • How can I uninstall the other djangos? – Chris Oct 09 '11 at 18:38

1 Answers1

3

receiver should be imported from the dispatch module:

from django.dispatch import receiver

Note that the receiver decorator was added in only in Django 1.3. You can check your django version by:

import django
django.VERSION

edit:

The wrong import statement is part of the __init__ module of the dispatch package itself, which can have gotten there by a version re-write. Delete the whole django package directory (..C:\Python27\Lib\site-packages\django) and re-install. It is a crude, but probably the best solution.

Remi
  • 20,619
  • 8
  • 57
  • 41