0

After re-installing Windows and QGIS 3.14 it seems like some PyQGIS algorithms are not working. For example:

processing.run("qgis:joinattributesbynearest", options)

gives

core.QgsProcessingException: Error: Algorithm qgis:joinattributesbynearest not found

I checked the algorithm ID in the latest docs, and it is correct.

For troubleshooting, I created a list of all available algorithms using

for alg in QgsApplication.processingRegistry().algorithms():
    print(alg.id(), "->", alg.displayName())

This results in quite a long file to share here but nowhere in the file I can find the algorithm name or identifier.

Note that the algorithm is available via the Processing Toolbox in the GUI, so I wonder where the PyQGIS version is hiding.

1

Found the solution. Turned out that the algorithm_id from documentation is not correct, as hovering over the algorithm name in the QGIS Processing Toolbox revealed that the algorithm is named: 'native:joinbynearest'. Didn't know that trick before so I always looked up the algorithm_id in the online documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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