Skip to main content

Hi, 

I am trying to run a custom python code that uses QGIS library in PythonCreator. However when I run the code I get this error:
Python Exception <ImportError>: DLL load failed while importing _core: The specified procedure could not be found.

I tried everything, I followed the documentation/manual how to setup custom python interpreter, I tried to setup dependencies and environment variables but none of that worked. Can someone tell me what am I doing wrong? Thanks!

Hi ​@spalrobert a colleague mentioned that this is likely due to the Python interpreters' ability to find the correct dependencies required by the library you are using. Perhaps try comparing the paths from your QGIS environment and in FME. (assuming that this works in QGIS)

import sys 
print(sys.path)

Add any paths that are present in QGIS but not FME.

sys.path.append(r"<missingPaths>")

Let us know if this returns different results. 


Hi ​@evieatsafe print(sys.path) results in:
'C:\\Program Files\\FME\\FME2024_1\\python', 'C:\\Program Files\\FME\\FME2024_1\\python\\python312', 'C:\\Program Files\\FME\\FME2024_1\\python\\fme-plugins-py312.zip', 'C:\\Users\\fa08119\\AppData\\Local\\anaconda3\\python312.zip', 'C:\\Users\\fa08119\\AppData\\Local\\anaconda3\\DLLs', 'C:\\Users\\fa08119\\AppData\\Local\\anaconda3\\Lib', 'C:\\Program Files\\FME\\FME2024_1', 'C:\\Users\\fa08119\\AppData\\Local\\anaconda3', 'C:\\Users\\fa08119\\AppData\\Local\\anaconda3\\Lib\\site-packages', 'C:\\Users\\fa08119\\AppData\\Local\\anaconda3\\Lib\\site-packages\\win32', 'C:\\Users\\fa08119\\AppData\\Local\\anaconda3\\Lib\\site-packages\\win32\\lib', 'C:\\Users\\fa08119\\AppData\\Local\\anaconda3\\Lib\\site-packages\\Pythonwin', 'C:\\Program Files\\FME\\FME2024_1\\plugins', 'C:\\Users\\fa08119\\HCP\\Documents\\FME\\Plugins\\Python', 'C:\\Users\\fa08119\\HCP\\Skrivbord']
 

I am not sure what to do with the second command - sys.path.append….


Reply