On Aug 29, 6:43 am, Huuuze <[EMAIL PROTECTED]> wrote:
> I recently installed PostgreSQL 8.3.3 and psycopg 2 (latest from
> SVN).  When I attempt to start Django, I receive this error:
>
> File "/Library/Python/2.5/site-packages/django/db/backends/
> postgresql_psycopg2/base.py", line 20, in <module>
>     raise ImproperlyConfigured("Error loading psycopg2 module: %s" %
> e)
> django.core.exceptions.ImproperlyConfigured: Error loading psycopg2
> module: dlopen(/Library/Python/2.5/site-packages/psycopg2/_psycopg.so,
> 2): Library not loaded: /Users/buildfarm/pginstaller/server/staging/
> osx/lib/libpq.5.dylib
>   Referenced from: /Library/Python/2.5/site-packages/psycopg2/
> _psycopg.so
>   Reason: image not found
>
> Is this an issue with Django, psycopg, or both?

The error 'Image not found' on MacOS X normally means that the .so
doesn't contain the object code for the architecture that the process
it is being loaded into requires.

This is normally an issue for mod_python and mod_wsgi on Leopard where
the operating system supplied Apache is compiled with 64 bit support
and so runs as 64 bit on latest hardware. What happens is that default
compilation options for Python packages only builds them as 32 bit and
thus the 64 bit architecture wouldn't be present in C extension
modules.

Since 'python' executable is not fully fat and only runs as 32 bit
even if have 64 bit CPU, that you are getting this error when using
"runserver" would indicate that you have installed pyscopg binaries
from PowerPC, or if you compiled it yourself, that you have set it up
to be 64 bit in mistaken belief that since you have 64 bit CPU that
you would want to.

You can find further details on these architecture issues at:

  http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX

What you need to do is check build scripts for psycopg and ensure that
it doesn't only have '-arch x86_64' as option, when it probably also
needs to list at least '-arch i386'.

Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to