On Feb 27, 12:29 am, "omat * gezgin.com" <[email protected]> wrote:
> Thanks for the pointer.
>
> But I checked the architecture of the liblwgeom.so with 'file' and the
> result is:
> /usr/local/pgsql_saved_0804141532/lib/liblwgeom.so: Mach-O bundle i386
>
> which is the correct architecture for my Intel based macbook pro.
But how is your application being run in the first place? A MacBook
Pro has 64 bit Intel CPU. If you are running with mod_wsgi or
mod_python under operating system supplied Apache, then because Apache
will run as 64 bit, all the libraries etc have to be available as 64
bit as well.
So, explain how Python gets run. Are you running command line Python
to see this error, running Django under Apache.
Graham
> I am lost.
>
> On Feb 26, 1:25 pm, Graham Dumpleton <[email protected]>
> wrote:
>
> > On Feb 26, 10:07 pm, omat <[email protected]> wrote:
>
> > > Hi all,
>
> > > Following the instructions on inhttp://geodjango.org/docs/install.html,
> > > i managed to get to "Creating a Spatial Database Template" section.
>
> > > But when trying to execute the line below (as postgres user of
> > > course):
> > > $ psql -d template_postgis -f `pg_config --sharedir`/lwpostgis.sql
>
> > > it complained that it cannot find "liblwgeom".
>
> > > I found the lwpostgis.sql under directory:
> > > /usr/local/pgsql_saved_0804141532/share/
> > > which does not look very right. I examined the file and it has:
> > > ...
> > > CREATE OR REPLACE FUNCTION histogram2d_in(cstring)
> > > RETURNS histogram2d
> > > AS '$libdir/liblwgeom', 'lwhistogram2d_in'
> > > LANGUAGE 'C' IMMUTABLE STRICT; -- WITH (isstrict);
> > > ...
>
> > > $libdir shell variable is ''. I located the liblwgeom.so which is
> > > refered in the sql file here:
> > > /usr/local/pgsql_saved_0804141532/lib/liblwgeom.so
>
> > > When I tried to run the sql command above on the template_postgis db,
> > > fixing the paths manually, I get:
>
> > > ERROR: could not load library "/usr/local/pgsql_saved_0804141532/lib/
> > > liblwgeom.so": dlopen(/usr/local/pgsql_saved_0804141532/lib/
> > > liblwgeom.so, 10): no suitable image found. Did find:
> > > /usr/local/pgsql_saved_0804141532/lib/liblwgeom.so: mach-o, but
> > > wrong
> > > architecture
>
> > > Can it be that a conflicting version already existed and caused
> > > problems? Or what?
>
> > > I took the "build from source" path as instructed in the install
> > > documentation. I am using PostgreSQL 8.2 / PostGIS 1.3.5 on Mac OS X
> > > Leopard (10.5.6)
>
> > Read:
>
> > http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX
>
> > Various sections in this cover aspects of this problem which would be
> > relevant, even if you aren't usingmod_wsgi.
>
> > It is all because MacOS X can run on different architectures. That is,
> > PPC and Intel, plus 32 bit and 64 bit variants of same. Your library
> > doesn't have required architecture for what application that is using
> > it is running as.
>
> > Use 'file' command on the library to work out what architectures it
> > does provide. You then need to recompile stuff so it also includes
> > other architectures that may be required.
>
> > There are some pointers in that document about how to compile for all
> > architectures.
>
> > Graham
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---