[mapserver-users] Mapscript and Python

Alan Boudreault aboudreault at mapgears.com
Fri Sep 23 08:21:43 EDT 2011


Try to rebuild and recompile the python binding using an old version of SWIG. 
It seems that using a too recent swig causes issues sometime. I think I 
normally use swig 1.3.39.

Alan

On September 23, 2011 04:27:44 am Rustam Kamberov wrote:
> Hi everyone,
> 
> i have installed Mapserver, and downloaded Mapscript library for Python,
> followed the official procedure.
> 
> I tested http://localhost:8080/cgi-bin/test-cgi-mapscript.py example. it
> works perfectly. But when I try to import mapscript from Python IDLE, it
> 
> gives the error shown below:
> >>> import mapscript
> 
> Traceback (most recent call last):
>   File "<pyshell#0>", line 1, in <module>
>     import mapscript
>   File "C:\Python26\lib\site-packages\mapscript.py", line 25, in <module>
>     _mapscript = swig_import_helper()
>   File "C:\Python26\lib\site-packages\mapscript.py", line 24, in
> swig_import_helper
>     return _mod
> UnboundLocalError: local variable '_mod' referenced before assignment
> 
> 
> It seem the problem in the mapscript.py code. I would appreciate if you
> give me an advice what to do.
> 
> Thanks in advance,
> Rustam

-- 
Alan Boudreault
Mapgears
http://www.mapgears.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110923/c9d5a942/attachment.html


More information about the mapserver-users mailing list