<div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p style="margin:0px;padding:0px">Hi, i tried to run bat file (C:\OSGeo4W\OSGeo4W.bat), close ms-dos shell and run python</p>
<p style="margin:0px;padding:0px"><br></p></blockquote><div><div style>???</div><div style>If you close the shell you loose the environmental variables.</div><div style>OSGeo4W.bat sets env vars for the current shell, they&#39;re not kept as system env vars.</div>
<div style> </div><div style>You need those environmantal variables to leaverage the osgeo4w libraries.</div><div style>You ha mainly three choices:</div><div style><br></div><div style> - run your python script inside a shell where you have setup the env variables (like it is done by Osgeo4W.bat)</div>
<div style> - hard code the environmental variables inside your python script and add them to os.environ, and set the path to the python modules with sys.path</div><div style> - make the various environmantal variables statically availables as system env vars (Control Panel -&gt; Systems -&gt; etc.)</div>
<div style><br></div><div style>giovanni</div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p style="margin:0px;padding:0px"></p><p style="margin:0px;padding:0px">
<br></p><p style="margin:0px;padding:0px"><br></p><p style="margin:0px;padding:0px"><br></p>
<blockquote>
----Messaggio originale----<br>
Da: <a href="mailto:giohappy@gmail.com" target="_blank">giohappy@gmail.com</a><br>
Data: 24/05/2012 17.15<br>
A: &quot;<a href="mailto:francescoboccacci@libero.it" target="_blank">francescoboccacci@libero.it</a>&quot;&lt;<a href="mailto:francescoboccacci@libero.it" target="_blank">francescoboccacci@libero.it</a>&gt;<br>
Cc: &lt;<a href="mailto:qgis-developer@lists.osgeo.org" target="_blank">qgis-developer@lists.osgeo.org</a>&gt;<br>
Ogg: Re: [Qgis-developer] from qgis.core impor * Windows problems<br>
<br>
Hi Francesco,<div>are you using osgeo4w? In that case I suggest you to have a look to the startup .bat files (like C:\OSGeo4W\OSGeo4W.bat), that setup the right evnironment (python pat, bin dires, etc.)</div><div><br></div>

<div>In general you have to add the various Qt and Qgis DLLs to the PATH, and configure the python paths to be able to peak the qgis modules. </div><div><br></div><div>giovanni<br><br><div class="gmail_quote">2012/5/24 <a href="mailto:francescoboccacci@libero.it" target="_blank">francescoboccacci@libero.it</a> <span dir="ltr">&lt;<a href="mailto:francescoboccacci@libero.it" target="_blank">francescoboccacci@libero.it</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
i have a problem in my Windows PC. I try to use a python script that call qgis<br>
modules.<br>
I tried to do :<br>
<br>
&gt;&gt;from qgis.core import *<br>
<br>
i receive ImportError: DLL load failed ....<br>
<br>
How i have to configure my environment variables to get these modules?<br>
I try to find some solution on web but they aren&#39;t work.<br>
<br>
Thanks<br>
<br>
Francesco<br>
<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div><br></div>
<br>
</blockquote><p><br></p><div style="width:1px;min-height:1px;overflow:hidden"> </div></blockquote></div><br>