Hi, I am following the instructions here to great success but I've hit a snag when going to run the manage.py script to create the database tables.

I have Postgres 8.4 installed and configured, because I desire its full text search, but I get errors seemingly to do with forum_modules wanting mysqlfulltext.

I am a newbie to configuring OSQA so this has me confused. Any advice on what I'm doing wrong would be appreciated. BTW I am using today's latest svn trunk.

Here are the manage.py errors:

Traceback (most recent call last):
  File "/opt/osqa/forum_modules/mysqlfulltext/__init__.py", line 8, in <module>
    import MySQLdb
ImportError: No module named MySQLdb
Traceback (most recent call last):
  File "/opt/osqa/../osqa/forum_modules/mysqlfulltext/__init__.py", line 8, in <module>
    import MySQLdb
ImportError: No module named MySQLdb
Traceback (most recent call last):
  File "manage.py", line 13, in <module>
    execute_manager(settings)
  File "/opt/ActivePython-2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/opt/ActivePython-2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/ActivePython-2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/opt/ActivePython-2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 67, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/opt/ActivePython-2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/ActivePython-2.7/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 7, in <module>
    from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
  File "/opt/ActivePython-2.7/lib/python2.7/site-packages/django/core/management/sql.py", line 6, in <module>
    from django.db import models
  File "/opt/ActivePython-2.7/lib/python2.7/site-packages/django/db/__init__.py", line 78, in <module>
    connection = connections[DEFAULT_DB_ALIAS]
  File "/opt/ActivePython-2.7/lib/python2.7/site-packages/django/db/utils.py", line 93, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/opt/ActivePython-2.7/lib/python2.7/site-packages/django/db/utils.py", line 33, in load_backend
    return import_module('.base', backend_name)
  File "/opt/ActivePython-2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/ActivePython-2.7/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 24, in <module>
    raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2

And my settings_local.py database settings are:

DATABASES = {
    'default': {
        'ENGINE': 'postgresql_psycopg2',
        'NAME': 'osqa',
        'USER': 'uosqa',
        'PASSWORD': '********',
        'HOST': 'localhost',
        'PORT': '',
    }
}

asked 18 Jan, 00:14

mlepage's gravatar image

mlepage
1111
accept rate: 0%


The MySQL traceback is a red herring, that module just happens to print the details when the module load fails and won't actually cause any problems. Also, don't remove the module, just add it to DISABLED_MODULES in settings_local.py to suppress the error.

This is your problem:

django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2

Change ENGINE to django.db.backends.postgresql_psycopg2. If you have further problems, make sure psycopg2 is installed with easy_install/pip

link

answered 10 Apr, 08:07

Danny%20Thomas's gravatar image

Danny Thomas
7651014
accept rate: 40%

edited 10 Apr, 08:10

-1

I had the same issue and it looks like a bug. Just remove the directory of mysqlfulltext:

rm -rf forum_modules/mysqlfulltext

link

answered 07 Apr, 08:49

Andrii's gravatar image

Andrii
01
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×62
×56
×19
×11

Asked: 18 Jan, 00:14

Seen: 622 times

Last updated: 10 Apr, 08:10

powered by OSQA