[Qgis-user] QGIS 3 Standalone Python Script

DT dmofot at gmail.com
Fri Aug 3 15:17:41 PDT 2018


OSX, version 10.13.6
Python 3.6.6
QGIS 3.2.1

QGIS itself is working fine with no errors, but I'm trying to write a
standalone python script that utilizes a QGIS3 tool and I keep running into
Qt errors.  This works fine:

import os
import sys
sys.path.append('/Applications/QGIS3.app/Contents/Resources/python/')
sys.path.append('/Applications/QGIS3.app/Contents/Resources/python/plugins')
from qgis.core import *

But as soon as I try to do:

app = QgsApplication([],True)

I get the following error:

>>> app = QgsApplication([],True)
This application failed to start because it could not find or load the Qt
platform plugin "cocoa"
in "".

Reinstalling the application may fix this problem.
Abort trap: 6

Anybody have an idea where I'm going wrong?  My Google fu has only managed
to turn up setting paths for Windows and not OSX.  Thanks!

DT
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180803/6c55214f/attachment.html>


More information about the Qgis-user mailing list