Error: No module named messages after installing python-django-debug-toolbar

I159 picture I159 · May 7, 2011 · Viewed 8.2k times · Source

My Django version is 1.2.5 it runs in Python 2.6.5. I installed debug_toolbar, from Ubuntu Software Center and it's fell down with No module named messages error. With debug_toolbar version of Django - 1.1.1, without debug_toolbar - 1.2.5. When I removed it, Django runs well. What is wrong with debug_toolbar? How can I fix it?

Before install:

>>> import django
>>> django.VERSION
(1, 2, 5, 'final', 0) 

i159@i159-desktop:~/djproj/pastebin$ python2.6 manage.py runserver
Validating models...
0 errors found
...

After install:

>>> import django
>>> django.VERSION
(1, 1, 1, 'final', 0)

i159@i159-desktop:~/djproj/pastebin$ python2.6 manage.py runserver
Error: No module named messages

Answer

Alasdair picture Alasdair · May 7, 2011

The Ubuntu package for debug toolbar has a dependency on python-django, and for your version of Ubuntu, it is installing Django 1.1.1. The Messages app was installed in version 1.2, hence the error after you have installed the debug toolbar package.

I recommend you install debug_toolbar using pip.

# Install pip if you don't already have it 
sudo apt-get install python-pip
pip install django_debug_toolbar