2

After installing the latest QGIS version for Mac (2.18.0), geoprocessing tools such as "Difference" and "Symmetrical Difference" are no longer working. Instead, the log window shows the following error message:

2016-11-14T14:28:43 2 Uncaught error while executing algorithm Traceback (most recent call last): File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/core/GeoAlgorithm.py", line 203, in execute self.processAlgorithm(progress) File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/qgis/Difference.py", line 71, in processAlgorithm geomType = QgsWKBTypes.multiType(QGis.fromOldWkbType(layerA.wkbType())) NameError: global name 'QgsWKBTypes' is not defined

Does anyone have an idea what the problem might be and how to fix it?

2
  • Did you send to trash QGIS old version before installing V.2.18.0?
    – aldo_tapia
    Commented Nov 14, 2016 at 13:50
  • Yes I completely removed the old version
    – guyus
    Commented Nov 16, 2016 at 7:49

2 Answers 2

4

This was a bug in 2.18.0 which has been fixed meanwhile. Wait for 2.18.1.

Or install qgis2 from homebrew with the --devel switch.

2
  • OK, thanks for the info! In that case I'll just wait for the new release.
    – guyus
    Commented Nov 16, 2016 at 7:50
  • By the way, for python errors in plugins it's always better to directly open a bug report (plugins all have a link to a bug_tracker in the plugin manager) - after checking if the same problem has not been reported before. Commented Nov 16, 2016 at 7:58
1

This issue was not resolved with 2.18 release - it is specific to the "difference" function. You can add the following to line 32 of the difference.py file, which for me was located at C:\Program Files\QGIS 2.18\apps\qgis\python\plugins\processing\algs\qgis:

from qgis.core import:

  • QGis

  • QgsFeatureRequest

  • QgsFeature

  • QgsGeometry

  • QgsWKBTypes

Adding the QgsWKBTypes import allowed me to utilize the difference function.

Not the answer you're looking for? Browse other questions tagged or ask your own question.