I would like to join attributes by location using standalone PyQGIS but I'm getting error. I have QGIS 3.16 installed on my machine.

from qgis.core import *

QgsApplication.setPrefixPath("C:/Program Files/QGIS 3.16/apps/qgis", True)
qgs = QgsApplication([], True)

import processing
from processing.core.Processing import Processing

processing.run("qgis:joinattributesbylocation", {

And I'm getting the error:

Traceback (most recent call last): File "", line 1, in File "C:/PROGRA~1/QGIS3~1.16/apps/qgis/./python/plugins\processing\tools\general.py", line 108, in run return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context) File "C:/PROGRA~1/QGIS3~1.16/apps/qgis/./python/plugins\processing\core\Processing.py", line 141, in runAlgorithm raise QgsProcessingException(msg) _core.QgsProcessingException: Error: Algorithm qgis:joinattributesbylocation not found

What is the problem?

  • What if you try running Processing.updateAlgsList() after Processing.initialize()? Additionally make sure that %QGIS_PATH%\apps\qgis\python\plugins\processing is added to the PYTHON_PATH environment variable.
    – Taras
    Commented Nov 3, 2020 at 7:27
  • I solved that problem, thank you. I have another problem: gis.stackexchange.com/questions/378188/… Commented Nov 3, 2020 at 7:29

2 Answers 2



I transfered folder "platforms" (C:\Program Files\QGIS 3.16\apps\qt5\plugins\platforms) to:

C:\Program Files\QGIS 3.16\bin


C:\Program Files\QGIS 3.16\apps\Python37


There is a more advanced plug with in QGIS plugin repo called NNJoin which joins two vector layers (the input and the join layer) based on nearest neighbor relationships.

please refer the page NNJoinPlugin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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