<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1462287696136_52344" dir="ltr"><span>Hello, </span><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" id="yui_3_16_0_ym19_1_1462287696136_52352">Jürgen</span></div><div id="yui_3_16_0_ym19_1_1462287696136_52344" dir="ltr"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"><br></span></div><div id="yui_3_16_0_ym19_1_1462287696136_52344" dir="ltr"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;">Thank you.</span></div><div id="yui_3_16_0_ym19_1_1462287696136_52344" dir="ltr"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"><br></span></div><div id="yui_3_16_0_ym19_1_1462287696136_52344" dir="ltr"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" id="yui_3_16_0_ym19_1_1462287696136_52455">I am using QGIS in Windows. Do I need to set paths?</span></div><div id="yui_3_16_0_ym19_1_1462287696136_52344" dir="ltr"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"><br></span></div><div id="yui_3_16_0_ym19_1_1462287696136_52344" dir="ltr"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;">Regards.</span></div><div id="yui_3_16_0_ym19_1_1462287696136_52344" dir="ltr"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"><br></span></div><div id="yui_3_16_0_ym19_1_1462287696136_52344" dir="ltr"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;">David</span></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> On Wednesday, 4 May 2016, 12:49, Jürgen E. Fischer <jef@norbit.de> wrote:<br></font></div> <br><br> <div class="y_msg_container">Hi David,<br clear="none"><div class="yqt8023235634" id="yqtfd45807"><br clear="none">On Wed, 04. May 2016 at 11:43:24 +0000, David Shi wrote:<br clear="none">> How to set python search path for standalone script?<br clear="none">> <br clear="none">> I am writing a standalone script, but it can not import qgis.core and other processing. modules.</div><br clear="none"><br clear="none">In OSGeo4W there is a batch file python-qgis.bat you can pass your script to:<br clear="none"><br clear="none">@echo off<br clear="none">call "%~dp0\o4w_env.bat"<br clear="none">@echo off<br clear="none">path %OSGEO4W_ROOT%\apps\qgis\bin;%PATH%<br clear="none">set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/qgis<br clear="none">set GDAL_FILENAME_IS_UTF8=YES<br clear="none">rem Set VSI cache to be used as buffer, see #6448<br clear="none">set VSI_CACHE=TRUE<br clear="none">set VSI_CACHE_SIZE=1000000<br clear="none">set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\qgis\qtplugins;%OSGEO4W_ROOT%\apps\qt4\plugins<br clear="none">set PYTHONPATH=%OSGEO4W_ROOT%\apps\qgis\python;%PYTHONPATH%<br clear="none">"%OSGEO4W_ROOT%"\bin\python.exe %*<br clear="none"><br clear="none">PYTHONPATH and QGIS_PREFIX_PATH are most important.<br clear="none"><br clear="none"><br clear="none">Jürgen<br clear="none"><br clear="none">-- <br clear="none">Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31<br clear="none">Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50<br clear="none">Software Engineer D-26506 Norden <a shape="rect" href="http://www.norbit.de/" target="_blank">http://www.norbit.de</a><br clear="none">QGIS release manager (PSC) Germany IRC: jef on FreeNode <br>_______________________________________________<br clear="none">Qgis-user mailing list<br clear="none"><a shape="rect" ymailto="mailto:Qgis-user@lists.osgeo.org" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br clear="none">List info: <a shape="rect" href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br clear="none">Unsubscribe: <a shape="rect" href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br><br></div> </div> </div> </div></div></body></html>