<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Hi,<br>
    Apologies for asking help on what hopefully might turn out to be
    trivial, but I am pretty much blue in the face googling and asking
    Gemini for help.<br>
    <br>
    There are 2 questions in this email:<br>
    <br>
    I have a Windows 11 OSGEO4W installation QGIS 3.36.0 and grass (and
    more).<br>
    I use PyCharm 2023.3.4 (Community Edition) - but not yet configured
    "nicely" for QGIS as I am mostly in a non-Open Source environment.<br>
    Most of the stuff I write is python is for "problem fixes" and these
    python scripts ideally run on a windows command-line with a BAT
    file.<br>
    <br>
    So, in this scenario below, I keep getting:       ..... <b>has no
      attribute 'run'<br>
    </b>This whether I am running inside PyCharm or on the command-line
    through below batch job.<br>
    <br>
    <b>Question #1</b><br>
    <b>What is the correct bat file structure for running python
      scripts?</b><br>
    I currently have [below] but is it optimal?<br>
    <blockquote>SET QGIS_PATH=C:\OSGeo4W\apps\qgis<br>
      call "C:\OSGeo4W\bin\o4w_env.bat"<br>
      SET PYTHONPATH=%QGIS_PATH%\python;%PYTHONPATH%<br>
      SET PATH=%QGIS_PATH%\bin;%PATH%<br>
      C:\OSGeo4W\apps\Python39\python.exe   
      Z:\Projects\Development\python_QGIS\qgis_tests\qgisrun.py<br>
      pause<br>
    </blockquote>
    <b>Question #2</b><br>
    I have tried many various import options, but I cannot get past the
     <b>has no attribute 'run'</b>  error from python below code:<br>
    Minimalst as this code is, it should run without adding anything
    else, should it?<br>
    <blockquote>from qgis.core import QgsProcessing<br>
      shp_inErfPoly = 'Z:\\Erven_1February2024.shp'<br>
      shp_outErfFix = 'Z:\\Erven_1February2024_FixGeo.shp'<br>
      QgsProcessing.run("native:fixgeometries", { 'INPUT':
      shp_inErfPoly, 'METHOD': 1,  'OUTPUT': shp_outErfFix})<br>
    </blockquote>
    <br>
    <br>
    Some pointers on what to do or where to read would be great.<br>
    <br>
    Thanks in advance,<br>
    Zoltan<br>
    <br>
    <br>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 

=============================================
Zoltan Szecsei GPrGISc 0031
Director, Geograph (Pty) Ltd.
GIS and Photogrammetric Services

Cape Town, South Africa.

Mobile: +27-83-6004028 (Signal, not WhatsApp)
        +974-5058-8729 
        +36-20-4808362

<a class="moz-txt-link-abbreviated" href="http://www.geograph.co.za">www.geograph.co.za</a>
=============================================</pre>
  </body>
</html>