[mapserver-users] Mapscript and Python: no mapscriptc module.

Ben Logan ben at wblogan.net
Mon Apr 8 04:09:00 PDT 2002


I've been searching the docs and list archives, but haven't found much
on getting the Python Mapscript wrapper to work.  I changed to the
mapscript/python directory, ran python, and tried to import
mapscript.py, but got the following error:

Python 1.5.2 (#1, Mar  3 2001, 01:35:43)  [GCC 2.96 20000731 (Red Hat
Linux 7.1 2 on linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import mapscript
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "mapscript.py", line 2, in ?
    import mapscriptc
ImportError: No module named mapscriptc

Here's the contents of the directory:

CVS
examples
mapscript.i
mapscript.py
mapscript.pyc
mapscript_wrap.c

As you can see, there is no mapscriptc.* .  From the messages in the
list archives is appears that I need to compile mapscript_wrap.c into
mapscriptcmodule.so (since I have a mapscript_wrap.c, I'm assuming
that I don't need to run SWIG--if so I'll have to install it first).

I ran

gcc -c mapscript_wrap.c -I/usr/include/python1.5 -o mapscriptcmodule.o

without any errors.  I then ran

ld -shared mapscriptcmodule.o -o mapscriptcmodule.so

also successful.  However, now I get the same error as the OP:

Python 1.5.2 (#1, Mar  3 2001, 01:35:43)  [GCC 2.96 20000731 (Red Hat
Linux 7.1 2 on linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import mapscript
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "mapscript.py", line 2, in ?
    import mapscriptc
ImportError: ./mapscriptcmodule.so: undefined symbol: ms_error

Norman Vine responded to his post and attached a setup script to link
the module with the necessary mapscript libraries, but the list
archive software won't let me download it.

I tried

ld -o mapscriptcmodule.so mapscriptcmodule.o -shared ../../libmap.a

and it seemed to work, but now I get this error:

Python 1.5.2 (#1, Mar  3 2001, 01:35:43)  [GCC 2.96 20000731 (Red Hat
Linux 7.1 2 on linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import mapscript
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "mapscript.py", line 2, in ?
    import mapscriptc
ImportError: ./mapscriptcmodule.so: undefined symbol: gdImageCreate

I have a feeling this could go on for a while.  As you can probably
tell, I don't know too much about building libraries. :) Can anyone
help me out?  BTW, I'm using MapServer 3.5 and you can see my system
setup from the errors above.

Thanks,
Ben

-- 
Ben Logan: ben at wblogan dot net
OpenPGP Key KeyID: A1ADD1F0

((lambda (foo) (bar foo)) (baz))



More information about the MapServer-users mailing list