Getting “No module named django_messages”

2019-07-30 15:20发布

问题:

I'm working with a Django app, called DjangoBB. I'm trying to install it on my server, but I'm getting stuck with the messages plugin/app.

This output doesn't make any sense to me...

# pip install django-messages
Requirement already satisfied (use --upgrade to upgrade): django-messages in /usr/local/lib/python2.7/dist-packages
Cleaning up...
# python manage.py runserver
Error: No module named django_messages

I had the same problem with other modules, like django-registration, and django_notifications, but I just popped them into pip and then went through again and got a new missing dependency. It's stuck here though. Any ideas?


My INSTALLED_APPS:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sitemaps',
    'django.contrib.admin',
    'django.contrib.admindocs',
    'django.contrib.humanize',
    'registration',
    'pagination',
    'django_authopenid',
    'djangobb_forum',
    'haystack',
    'django_messages',
)

回答1:

The actual app is called 'messages'. Make sure you add it to your INSTALLED_APPS.



回答2:

You probably need to add 'django_messages' to your list of INSTALLED_APPS in settings.py



回答3:

On my server I had version 0.4.4. On my local machine I had version 0.5.0.pre.

The code for that isn't available through pip, but the BB app requires it. I somehow downloaded it from here and ran python setup.py install.

Now the messages module is unavailable, but django_messages is exposed.