I am getting the following error:
MOD_PYTHON ERROR
ProcessId: 4196
Interpreter: 'ale.local'
ServerName: 'ale.local'
DocumentRoot: '/Library/WebServer/Documents'
URI: '/~ale/newsite/'
Location: '/~ale/newsite/'
Directory: None
Filename: '/Users/ale/Sites/newsite/'
PathInfo: ''
Phase: 'PythonHandler'
Handler: 'django.core.handlers.modpython'
Traceback (most recent call last):
File "/Library/Python/2.5/site-packages/mod_python/importer.py",
line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)
File "/Library/Python/2.5/site-packages/mod_python/importer.py",
line 1229, in _process_target
result = _execute_target(config, req, object, arg)
File "/Library/Python/2.5/site-packages/mod_python/importer.py",
line 1128, in _execute_target
result = object(arg)
File "/Library/Python/2.5/site-packages/django/core/handlers/
modpython.py", line 177, in handler
return ModPythonHandler()(req)
File "/Library/Python/2.5/site-packages/django/core/handlers/
modpython.py", line 145, in __call__
self.load_middleware()
File "/Library/Python/2.5/site-packages/django/core/handlers/
base.py", line 29, in load_middleware
mod = __import__(mw_module, {}, {}, [''])
File "/Library/Python/2.5/site-packages/django/contrib/sessions/
middleware.py", line 2, in <module>
from django.contrib.sessions.models import Session
File "/Library/Python/2.5/site-packages/django/contrib/sessions/
models.py", line 3, in <module>
from django.db import models
File "/Library/Python/2.5/site-packages/django/db/__init__.py", line
11, in <module>
backend = __import__('django.db.backends.%s.base' %
settings.DATABASE_ENGINE, {}, {}, [''])
File "/Library/Python/2.5/site-packages/django/db/backends/mysql/
base.py", line 12, in <module>
raise ImproperlyConfigured, "Error loading MySQLdb module: %s" % e
ImproperlyConfigured: Error loading MySQLdb module: dynamic module
does not define init function (init_mysql)
Can anyone help please? Thank you very much in advance!!
Ale
On Dec 27 2007, 11:35 am, Oliver Beattie <[EMAIL PROTECTED]> wrote:
> Right, sorted this out. When running setup.py build, it will spit out
> the compilation command it's executing at the bottom of its output.
> You will notice that it doesn't include an x86_64architecture, so you
> need to add one. Edit the command so it looks like:
>
> sudo gcc -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch
> ppc -arch x86_64 build/temp.macosx-10.5-i386-2.5/_mysql.o -L/usr/local/
> mysql/lib/mysql -lmysqlclient -lz -lm -o build/lib.macosx-10.5-
> i386-2.5/_mysql.so
>
> And run it (notice I added sudo at the beginning, also in theory you
> should be okay removing all the other architectures). Then you should
> be able to run setup.py install withnoproblems.
>
> *Phew!*
>
> On Dec 27, 9:07 am, Oliver Beattie <[EMAIL PROTECTED]> wrote:
>
> > I have compiled it for
> > 64-bit:http://farm3.static.flickr.com/2013/2140077639_7abe03b5fb_o.gif
>
> > Yet I still get this error, am I missing something?
>
> > I would be reluctant to make force Apache into 32-bit, but if that's
> > the only option...
>
> > On Dec 27, 12:18 am, Graham Dumpleton <[EMAIL PROTECTED]>
> > wrote:
>
> > > On Dec 27, 9:49 am, Oliver Beattie <[EMAIL PROTECTED]> wrote:
>
> > > > Did anyone ever get this working, I am tearing my hair out here trying
> > > > to figure it out; I finally get it to build and now I'm getting:-
>
> > > > ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Library/
> > > > WebServer/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg-
> > > > tmp/_mysql.so, 2):nosuitable image found. Did find:
> > > >
> > > > /Library/WebServer/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.5-
> > > > i386.egg-tmp/_mysql.so:nomatchingarchitectureinuniversalwrapper
>
> > > > Please, please, please, somebody help! I've been using Django for ages
> > > > under a 32-bit system and need to get it up and running ASAP...
>
> > > The correct answer was that you need to get a version of MySQL Python
> > > client compiled for 64 bit Intel.
>
> > > If such a thing is still not available for download and you are not
> > > capable of compiling it yourself, the only other option is to thin out
> > > the httpd executable so that it is only i386.
>
> > > This can be done by the following procedure. Be very careful in doing
> > > this as you are modifying OS files. Only do it if you are really
> > > desperate and keep backups.
>
> > > cd /usr/sbin
>
> > > sudo mv ./httpd ./httpd.fat
> > > sudo lipo ./httpd.fat -thin i386 -output ./httpd.i386
> > > sudo ln -s ./httpd.i386 ./httpd
>
> > > After doing that, you should end up with:
>
> > > $ file ./httpd.fat
> > > ./httpd.fat: Mach-Ouniversalbinary with 4 architectures
> > > ./httpd.fat (forarchitectureppc7400): Mach-O executable ppc
> > > ./httpd.fat (forarchitectureppc64): Mach-O 64-bit executable ppc64
> > > ./httpd.fat (forarchitecturei386): Mach-O executable i386
> > > ./httpd.fat (forarchitecturex86_64): Mach-O 64-bit executable x86_64
>
> > > $ file ./httpd.i386
> > > ./httpd.i386: Mach-O executable i386
>
> > > When Apache is now run, it should run as Intel and not Intel (64 bit).
> > > You can check what it runs as using the Activity Monitor application.
> > > Look at the Kind column to see what it runs as.
>
> > > You then hopefully shouldn't have a problem.
>
> > > Please indicate if this does help or not.
>
> > > Graham
>
> > > > On Nov 5, 6:44 pm, SneWs <[EMAIL PROTECTED]> wrote:
>
> > > > > It's actually really simple to build the client lib's you need to get
> > > > > the MySQL support working.
>
> > > > > Download the Community Server Source and you can build it from that.
>
> > > > > I hade the same problem but for QT and MySQL support,
> > > > > take a look at,http://demo.grenangen.se/drupal
>
> > > > > There you will find a simple instruction set on how to build the
> > > > > community server source for Leopard.
> > > > > If that doesn't help, get back to me and I'll try to help further.
>
> > > > > On Oct 31, 4:32 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > > > > > Argh. The "Universal" version of MySQL includes only: ppc, ppc64,
> > > > > > i386
>
> > > > > > [Macintosh:src/mysql-5.0.45-osx10.4-universal/lib] benha% file
> > > > > > libmysqlclient_r.a
> > > > > > libmysqlclient_r.a: Mach-Ouniversalbinary with 3 architectures
> > > > > > libmysqlclient_r.a (forarchitecturei386): current ar archive
> > > > > > libmysqlclient_r.a (forarchitectureppc64): current ar archive
> > > > > > libmysqlclient_r.a (forarchitectureppc): current ar archive
>
> > > > > > So that means that in order to link to the MySQL libs, we'll need to
> > > > > > build/install a 64-bit version of MySQL. Sigh...
>
> > > > > > Anyone have a set of reliable, working instructions for doing that?
>
> > > > > > -Ben
>
> > > > > > On Oct 30, 7:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Stuck in the same place.
>
> > > > > > > I'm guessing you d/l'd and installed the MySQL OSX 10.4 x86
> > > > > > > installer
> > > > > > > package from MySQL. I did. I think it's only i386.
>
> > > > > > > They also have aUniversalBinary OSX 10.4 file up there, but only
> > > > > > > in
> > > > > > > Tar format. I'm d/l'ing that now to try. Hopefully it's got the
> > > > > > >x86_64image in it as well.
>
> > > > > > > -Ben
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---