<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Miguel,</p>
<p>Maybe you are not initializing properly the processing module,
which requires a specific initialization.</p>
<p>Take a look of a running example, like this one [1], which I use
to create a geopackage (and export some layouts).<br>
</p>
<p>[1]
<a class="moz-txt-link-freetext" href="https://github.com/jgrocha/covid-pt/blob/master/geopackages/2geopackage.py">https://github.com/jgrocha/covid-pt/blob/master/geopackages/2geopackage.py</a></p>
<p>Please report back, if you are not able to get it running.<br>
</p>
<p>Jorge<br>
</p>
<div class="moz-cite-prefix">On 06/07/20 23:18, Miguel Eduardo
Rincon De Hoyos wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAAnmYAbac7HQKiKvYCeHZ29KOATSqowc3JUiCk34wu+8MRokNA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<p>Dears members<br>
</p>
<p> I am using Python for my postgraduate studies and I am
having
trouble running my code when I try to use processing in <span
class="" style="" id=":16i.1" tabindex="-1">Qgis</span>
using the command-line interface.</p>
<p>I think the error is really easy to fix it but right now I do
not know how to fix it. When I run my code I have this</p>
<pre class="gmail-lang-py gmail-prettyprint gmail-prettyprinted"><code><span class="gmail-typ"><span class="" style="" id=":16i.2" tabindex="-1">Traceback</span></span><span class="gmail-pln"> </span><span class="gmail-pun">(</span><span class="gmail-pln">most recent call last</span><span class="gmail-pun">):</span><span class="gmail-pln">
</span><span class="gmail-typ">File</span><span class="gmail-pln"> </span><span class="gmail-str">"urban_canopy_element.<span class="" style="" id=":16i.3" tabindex="-1">py</span>"</span><span class="gmail-pun">,</span><span class="gmail-pln"> line </span><span class="gmail-lit">100</span><span class="gmail-pun">,</span><span class="gmail-pln"> </span><span class="gmail-kwd">in</span><span class="gmail-pln"> </span><span class="gmail-pun"><</span><span class="gmail-pln">module</span><span class="gmail-pun">></span><span class="gmail-pln">
output</span><span class="gmail-pun">=</span><span class="gmail-pln">general</span><span class="gmail-pun">.</span><span class="gmail-pln">run</span><span class="gmail-pun">(</span><span class="gmail-str">'qgis:clip'</span><span class="gmail-pun">,{</span><span class="gmail-str">'INPUT'</span><span class="gmail-pun">:</span><span class="gmail-pln"> input_layer</span><span class="gmail-pun">,</span><span class="gmail-pln"> \
</span><span class="gmail-typ"><span class="" style="" id=":16i.4" tabindex="-1">NameError</span></span><span class="gmail-pun">:</span><span class="gmail-pln"> name </span><span class="gmail-str">'run'</span><span class="gmail-pln"> </span><span class="gmail-kwd">is</span><span class="gmail-pln"> </span><span class="gmail-kwd">not</span><span class="gmail-pln"> defined
</span></code></pre>
<pre class="gmail-lang-py gmail-prettyprint gmail-prettyprinted"><code><span class="gmail-pln">Thanks for the help
</span></code></pre>
<pre class="gmail-lang-py gmail-prettyprint gmail-prettyprinted"><code><span class="gmail-pln">Regards
</span></code></pre>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre>
</blockquote>
<div class="moz-signature">-- <br>
<title>Email Signature</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<table style="width: 525px; font-size: 11pt; font-family: Arial,
sans-serif;" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="text-align:center; font-size: 10pt; font-family:
Arial, sans-serif; border-right: 1px solid;
border-right-color: #fb6303; width: 125px; padding-right:
10px; vertical-align: top;" rowspan="6" width="125"
valign="top"> <a href="https://www.geomaster.pt"
target="_blank"><img alt="Logo" style="width:105px;
height:auto; border:0;"
src="https://geomaster.pt/wp-content/uploads/2017/02/cropped-geomaster300x300-1.png"
width="85" border="0"></a> </td>
<td style="padding-left:10px">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="font-size: 10pt; color:#0079ac;
font-family: Arial, sans-serif; width: 400px;
padding-bottom: 5px; padding-left: 10px;
vertical-align: top;" valign="top"> <strong><span
style="font-size: 14pt; font-family: Arial,
sans-serif; color:#fb6303;">Geomaster</span></strong><br>
<strong><span style="font-size: 11pt; font-family:
Arial, sans-serif; color:black;">Jorge Gustavo
Rocha</span></strong> <span
style="font-family: Arial, sans-serif;
font-size:11pt; color:#000000;"><span
style="padding-right: 5px; padding-left: 5px;">
| </span>Software Engineer</span> </td>
</tr>
<tr>
<td style="font-size: 10pt; color:#444444;
font-family: Arial, sans-serif; padding-bottom:
5px; padding-top: 5px; padding-left: 10px;
vertical-align: top; line-height:17px;"
valign="top"> <span><span style="color: #fb6303;"><strong>e:</strong></span><span
style="font-size: 10pt; font-family: Arial,
sans-serif; color:#000000;"> <a class="moz-txt-link-abbreviated" href="mailto:jgr@geomaster.pt">jgr@geomaster.pt</a></span></span>
<span><span style="padding-left:
5px;padding-right: 5px;"> | </span><span
style="color: #fb6303;"><strong>m:</strong></span><span
style="font-size: 10pt; font-family: Arial,
sans-serif; color:#000000;"> +351 910 333 888<br>
</span></span> <span><span style="color:
#fb6303;"><strong>g:</strong></span><span
style="font-size: 10pt; font-family: Arial,
sans-serif; color:#000000;"> 41.54094,-8.40490</span></span>
<span><span style="padding-left:
7px;padding-right: 5px;"> | </span><span
style="color: #fb6303;"><strong>v: </strong></span><span
style="font-size: 10pt; font-family: Arial,
sans-serif; color:#000000; padding-left: 7px;">
510 906 109<br>
</span></span> <span> <span style="color:
#fb6303;"><strong>a: </strong></span> </span>
<span> <span style="font-size: 10pt; font-family:
Arial, sans-serif; color: #000000;"><span> </span>Rua
António Cândido Pinto, 67, 4715-400 Braga<br>
</span></span> </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>