<div dir="ltr">Dear all,<div><br></div><div>i new to MapServer, and need some programming to make the (.map) file reusable for arbitrary shapefile(map rendering) which is part of my M.Sc research. For this i need to install Mapscript with python,i follow all the instructions on MapServer read me file for python .Moreover i m using python 2.6.2 and MapServer MS4W - MapServer 4 Windows - version 3.0.6. After following all the steps i got the following message:</div>
<div><div>IDLE 2.6.2 </div><div>>>> import mapscript</div><div><br></div><div>Traceback (most recent call last):</div><div> File "<pyshell#0>", line 1, in <module></div><div> import mapscript</div>
<div> File "C:\ms4w\Apache\cgi-bin\mapscript.py", line 25, in <module></div><div> _mapscript = swig_import_helper()</div><div> File "C:\ms4w\Apache\cgi-bin\mapscript.py", line 24, in swig_import_helper</div>
<div> return _mod</div><div>UnboundLocalError: local variable '_mod' referenced before assignment</div></div><div><br></div><div>The line 24 and 25 are as follow....................</div><div><br></div><div>(</div>
<div><br></div><div><div>from sys import version_info</div><div>if version_info >= (2,6,0):</div><div> def swig_import_helper():</div><div> from os.path import dirname</div><div> import imp</div><div> fp = None</div>
<div> try:</div><div> fp, pathname, description = imp.find_module('_mapscript', [dirname(__file__)])</div><div> except ImportError:</div><div> import _mapscript</div><div> return _mapscript</div>
<div> if fp is not None:</div><div> try:</div><div> _mod = imp.load_module('_mapscript', fp, pathname, description)</div><div> finally:</div><div> fp.close()</div>
<div> <b> Line24 </b> return _mod</div><div> <b>Line 25</b> _mapscript = swig_import_helper()</div><div> del swig_import_helper</div></div><div><br></div><div>)</div><div><br></div><div>Best Regard</div><div>
and</div><div><br></div><div>Thanks in advance..............</div><div>Sajid</div></div>