<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>&gt;&gt;&gt; import mapscript</div><div><br></div><div>Traceback (most recent call last):</div><div>  File &quot;&lt;pyshell#0&gt;&quot;, line 1, in &lt;module&gt;</div><div>    import mapscript</div>
<div>  File &quot;C:\ms4w\Apache\cgi-bin\mapscript.py&quot;, line 25, in &lt;module&gt;</div><div>    _mapscript = swig_import_helper()</div><div>  File &quot;C:\ms4w\Apache\cgi-bin\mapscript.py&quot;, line 24, in swig_import_helper</div>
<div>    return _mod</div><div>UnboundLocalError: local variable &#39;_mod&#39; 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 &gt;= (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(&#39;_mapscript&#39;, [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(&#39;_mapscript&#39;, 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>