Bug report #15352
Dissolve error : "local variable 'nElement' referenced before assignment"
|Affected QGIS version:||2.14.3||Regression?:||No|
|Operating System:||Mac OS||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||23284|
I'm experiencing the same issue as described in this recent thread : #14612
But the solution that closes the thread doesn't work for me. I'm a Mac user, and I tried deleting the folder /Users/williambray/.qgis2/processing, but that doesn't solve the problem in QGIS, and folder returns when I load QGIS again.
The Mac OS build provider includes these notes in the readme :
"Known Issues - Processing Configuration
If you have problems enabling algorithm providers or running algorithms, try resetting the "path" to the problem provider. Do this by deleting whatever is currently in the path setting for the provider, Processing should then automatically find the builtin path."
But how does one reset the path to the problem provider in this case?
MIT Sea Grant
#4 Updated by Ben Bray about 4 years ago
Sorry for the delay - thanks for your help Alexander. Here's the full error message, which results from running a model containing a Dissolve as its last step:
Algorithm model1 starting...
Prepare algorithm: QGISFIXEDDISTANCEBUFFER_1
Running subway stations Fixed distance buffer [1/4]
Parameters: INPUT =/Users/williambray/Desktop/O/MITSG_desktop/DO/QGIS_Level_2_Exercise_July2016/clippedstations.shp, DISTANCE =500, SEGMENTS =5, DISSOLVE =True
OK. Execution took 2.103 ms (1 outputs).
Prepare algorithm: QGISINTERSECTION_1
Running Intersection Zones [2/4]
Parameters: INPUT =/var/folders/b4/2q1t8h715x907926cpjft84c0000gn/T/processing79eec01207d04cc5abc74b13a69eb488/84f36e1b2894480098feb948d941ee34/OUTPUTALGQGISFIXEDDISTANCEBUFFER1.shp, INPUT2 =/Users/williambray/Desktop/O/MITSG_desktop/DO/QGIS_Level_2_Exercise_July2016/clippedzoningdistricts.shp
OK. Execution took 1.048 ms (1 outputs).
Prepare algorithm: QGISINTERSECTION_2
Running Intersection School [3/4]
Parameters: INPUT =/Users/williambray/Desktop/O/MITSG_desktop/DO/QGIS_Level_2_Exercise_July2016/clippedschools.shp, INPUT2 =/var/folders/b4/2q1t8h715x907926cpjft84c0000gn/T/processing79eec01207d04cc5abc74b13a69eb488/09eae90a64644ccc83061f3f201dafc4/OUTPUTALGQGISINTERSECTION1.shp
OK. Execution took 0.576 ms (1 outputs).
Prepare algorithm: QGISDISSOLVE_1
Running Dissolve [4/4]
Parameters: INPUT =/var/folders/b4/2q1t8h715x907926cpjft84c0000gn/T/processing79eec01207d04cc5abc74b13a69eb488/c62e00389c374c828f0e3d653f0ea8e4/OUTPUTALGQGISINTERSECTION2.shp, DISSOLVE_ALL =False, FIELD =SCHOOLDIST
Error executing algorithm Dissolve local variable 'nElement' referenced before assignment See log for more details
#6 Updated by Ben Bray about 4 years ago
2016-08-02T11:36:28 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
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/qgis/Dissolve.py", line 129, in processAlgorithm
nElement += 1
UnboundLocalError: local variable 'nElement' referenced before assignment
2016-08-02T11:36:28 2 Error executing algorithm Dissolve
local variable 'nElement' referenced before assignment
See log for more details
#8 Updated by Ben Bray about 4 years ago
'/Users/williambray/.qgis2/python/plugins/processing' does not exist. the only contents of the python folder is the folder 'expressions'
I'm running the latest point release available for Macs (2.14.3) as indicated on the QGIS website.
Where does the code say this error is already fixed?
#10 Updated by Ben Bray about 4 years ago
- Status changed from Closed to Reopened
- Target version set to Version 2.14
This issue was erroneously closed without resolution.
Picking-up where we left-off...
1) I do not have a a Processing plugin installed in my user directory - '~/.qgis2/python/plugins/processing' does not exist.
2) I'm running the latest point release available for Macs (2.14.3) as indicated on the QGIS website.
Any suggestions on what to do next?