<div dir="ltr">In my case I am using QGIS 2.18 (x32) and Python 2.7.13 (x32) on Windows 10, and I have already added the following environment variables:<div><br></div><div>PYTHONPATH:</div><div>C:\Program Files (x86)\QGIS 2.18\apps\qgis\python<br></div><div>C:\Program Files (x86)\QGIS 2.18\apps\qgis\python\plugins<br></div><div>C:\Program Files (x86)\QGIS 2.18\apps\Python27\Lib\site-<wbr>packages<br></div><div><br></div><div>PATH:</div><div>C:\Program Files (x86)\QGIS 2.18\bin<br></div><div>C:\Program Files (x86)\QGIS 2.18\apps\qgis\bin<br></div><div>C:\Python27<br></div><div>C:\Python27\Scripts<br></div><div><br></div><div>Here is the code where I want to import the classes:</div><div><br></div><div>#I would like to use these classes:<br></div><div><div># from qgis.core import *</div><div># from qgis.gui import *</div><div># from processing.core.Processing import Processing</div><div># import processing</div><div><br></div><div>from pywps.Process import WPSProcess </div><div>from types import FloatType</div><div><br></div><div>class Process(WPSProcess):</div><div> def __init__(self): </div><div> WPSProcess.__init__(self,</div><div> identifier = "processar", </div><div> title = "Title",</div><div> version = "1",</div><div> storeSupported = "false",</div><div> statusSupported = "false",</div><div> abstract = "Abstract") </div><div><span class="m_-2251798698842849892gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> </div><div> self.value1 = self.addLiteralInput(<wbr>identifier = "value1", title = "Input 1", type = FloatType)</div><div> self.value2 = self.addLiteralInput(<wbr>identifier = "value2", title = "Input 2", type = FloatType) </div><div> self.result = self.addLiteralOutput(<wbr>identifier = "result", title = "Result", type = FloatType)</div><div> </div><div> def execute(self):</div><div><span class="m_-2251798698842849892gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> # Here I would like to write the necessary code to execute the qgis:extractnodes algorithm:</div><div><span class="m_-2251798698842849892gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> # processing.runalg('qgis:<wbr>extractnodes', 'river.shp', 'output.shp')</div><div> </div><div><span class="m_-2251798698842849892gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> v1 = self.value1.getValue()</div><div> v2 = self.value2.getValue() <span class="m_-2251798698842849892gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> </div><div> self.result.setValue(v1 + v2)<span class="m_-2251798698842849892gmail-Apple-tab-span" style="white-space:pre-wrap"> </span> </div><div> return</div></div><div>------------------------------<wbr>--------</div><div><br></div><div>But even with those PATH variables configured I could not access the algorithm via WPS-client plugin.</div><div><br></div><div>Regards,</div><div><br></div><img width="0" height="0" class="mailtrack-img" src="https://mailtrack.io/trace/mail/c59d0948b76853e908f884476a5649a2ac9f66e4.png?u=394009"></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-02 17:31 GMT-02:00 Salvatore Larosa <span dir="ltr"><<a href="mailto:lrssvtml@gmail.com" target="_blank">lrssvtml@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Mon, Jan 2, 2017 at 4:31 PM, Eduardo Silverio da Silva <span dir="ltr"><<a href="mailto:eduardosilverio1990@gmail.com" target="_blank">eduardosilverio1990@gmail.com</a><wbr>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello people,<div><br></div><div>I have a python script that uses some classes from qgis and it runs correctly in my standalone app (IDLE Python). But when I try to publish the script through PyWPS (3.2.5), the process does not apear in the list of GetCapabilities. I think the problem is with the following imports:</div><div><br></div><div><div>from qgis.core import *</div><div>from qgis.gui import *</div><div>from processing.core.Processing import Processing</div><div><br></div><div>When I comment these lines the algorithm is showed.</div></div></div></blockquote><div><br></div></span><div>I guess the problem is with your environment variable, you should add the QGIS python and plugins paths to PYTHONPATH and probably the QGIS lib path to LD_LIBRARY.</div><div><br></div><div>Also, any error message could be useful in order to get some help from the community. :)</div><div><br></div><div>Regards,</div><div>-SL</div></div><span class="HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div class="m_9165890681227773245gmail_signature" data-smartmail="gmail_signature">Salvatore Larosa<br>linkedIn: <a href="http://linkedin.com/in/larosasalvatore" target="_blank">http://linkedin.com/in/<wbr>larosasalvatore</a><br>twitter: @lrssvt<br>skype: s.larosa<br>IRC: lrssvt on freenode<br></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><span style="font-size:12.8000001907349px">Eduardo Silverio da Silva</span><br></div><div>Mestrando em Ciências Geodésicas na Universidade Federal do Paraná</div><div>Engenheiro Cartógrafo e Agrimensor</div><div>+55 41 99873-6274</div></div></div></div></div></div></div></div></div>
</div>