Error: No module named messages after installing python-django-debug-toolbar
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 wr开发者_运维知识库ong 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
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
Combining the 2 previous answers and tweaking a bit got me sorted,
sudo apt-get purge python-django
pip install django
I hope that's useful.
Or you can also install django > 1.2 manually instead of from the repos.
First clean your existing django installation sudo apt-get purge python-django
. Then choose a mirror from the following link:
Django deb packages
sudo apt-get install build-essential libncursesw5-dev libreadline5-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev tk-dev
and upgrading django
to 1.3.1
django.VERSION
(1, 3, 1, 'final', 0)
worked for me
精彩评论