<div dir="ltr">Thanks William!  All is working now.<div><br></div><div>Chris - here's what is working for me:</div><div><a href="https://gist.github.com/dmofot/94345126db10660053ccfb0d76a1e32a">https://gist.github.com/dmofot/94345126db10660053ccfb0d76a1e32a</a><br></div><div><br></div><div>and I'm just passing the layers (full path) into the script.  For example, /Users/<user>/Documents/<shp_filename.shp></div><div><br></div><div>DT</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 6, 2018 at 11:03 AM, Chris B <span dir="ltr"><<a href="mailto:snowstorms@mac.com" target="_blank">snowstorms@mac.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks so much for helping out with this.<br>
<br>
The script now no longer fails looking for Qt, great!<br>
<br>
But I'm still getting a very basic error -- loading a layer from the file<br>
system doesn't work.  Here's the script:<br>
<br>
import sys<br>
<br>
sys.path.insert(0,'/<wbr>Applications/QGIS3.app/<wbr>Contents/Frameworks/')<br>
<span class="">sys.path.insert(0,'/<wbr>Applications/QGIS3.app/<wbr>Contents/Resources/python/')<br>
sys.path.insert(0,'/<wbr>Applications/QGIS3.app/<wbr>Contents/Resources/python/<wbr>plugins')<br>
<br>
</span>from qgis.core import (<br>
     QgsApplication, <br>
     QgsProcessingFeedback, <br>
     QgsVectorLayer<br>
)<br>
from qgis.analysis import QgsNativeAlgorithms<br>
<br>
# Start the QGIS App<br>
<br>
qgs = QgsApplication([], False)<br>
qgs.initQgis()<br>
<br>
# Start Processing plugin<br>
<br>
import processing<br>
from processing.core.Processing import Processing<br>
Processing.initialize()<br>
QgsApplication.<wbr>processingRegistry().<wbr>addProvider(<wbr>QgsNativeAlgorithms())<br>
<br>
# Load Layer<br>
<br>
layer = QgsVectorLayer('21185.shp', 'my layer', 'ogr')<br>
<br>
if not layer.isValid():<br>
  print("Layer failed to load!")<br>
<br>
# Set parameters<br>
<br>
params = {<br>
    'INPUT': layer,<br>
    'OUTPUT': 'memory:'<br>
}<br>
feedback = QgsProcessingFeedback()<br>
<br>
# Run processing algorithm<br>
<br>
res = processing.run("native:<wbr>extractvertices", params, feedback=feedback)<br>
res['OUTPUT'] # Access your output layer<br>
<br>
When I test for layer validity, it says the layer fails to load and then<br>
segfaults (which makes sense since the object is null).<br>
<br>
I tried referring to the file locally (eg. 'file.shp') and from the root of<br>
the drive ('/Users/[user]/path/to/<wbr>script/file.shp') and neither worked.<br>
<br>
Am I missing something for QgsVectorLayer to work?  Seems like an odd error.<br>
<br>
Thanks again,<br>
C.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
--<br>
Sent from: <a href="http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html" rel="noreferrer" target="_blank">http://osgeo-org.1560.x6.<wbr>nabble.com/QGIS-User-f4125267.<wbr>html</a><br>
______________________________<wbr>_________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-user</a></div></div></blockquote></div><br></div>