[mapserver-users] missing __init__ in python mapscript (fwd)

trussell at mtcsc.com trussell at mtcsc.com
Mon Jan 28 18:36:30 PST 2002


Norman,

I actually found another script that you posted on the mapserver list that
simply builds mapscriptcmodule.so from mapscript_wrap.c and config.c from
the python distribution. I was able to modify it and successfully build
python mapscript. However, Python still complains about the missing __init__
function when I go to import it.

Since I was able to successfully build a working python extension using the
method from Beazley's book, I would like to explore the possibility of
editing Setup so that it works for a large project like Mapserver. Any
pointers would be appreciated.

Tom
----- Original Message -----
From: "Norman Vine" <nhv at cape.com>
To: "'Tom Russell'" <trussell at mtcsc.com>;
<mapserver-users at lists.gis.umn.edu>
Sent: Sunday, January 27, 2002 3:45 AM
Subject: RE: [mapserver-users] missing __init__ in python mapscript (fwd)


> Tom Russell writes:
> >
> >Norman,
> >
> >It appears that the problem is indeed related to the Setup
> >file, as I was
> >able to reproduce the 'missing __init__" error on a sample project by
> >leaving out a middle term, which is the original c source file(s).
> >Apparently, it should be something like the following:
> >
> >*shared*
> >mapscriptc layer.c label.c mapfile.c ... mapscript_wrap.c
> >
> >It doesn't seem correct that every Mapserver source file
> >should have to be listed, though.
>
> Apologies
>
> you also need to add all of the libraries that are needed by mapserver
> and necessary include paths  ie the same as you would pass to
> a cli invocation of gcc to link a module against libmap.a
>
> see your python_source / Modules / setup   file for examples of
> how this is done for other modules
>
> HOWEVER  this is a deprecated way of building extension modules
> unfortunately because mapserver can be configured in a multitude
> of different configurations it is difficult to come up with a generic
> python distutils script which would make this trivial.
>
> I have put a python script at
> http://www.vso.cape.com/~nhv/files/python/mapscript/setup.py
>
> That I use to build a fairly 'stock' python mapscript module
> on Cygwin that might just work for you and can at least  be used as a
> 'template' for building a python mapscript on other systems
>
> YMMV
>
> Cheers
>
> Norman
>




More information about the MapServer-users mailing list