I'm trying to build a Python plugin in QGIS which does some raster image processing. The processing itself is done via a .dll. Hence, I'd like to bind it with ctypes. First of all: is it possible to use ctypes with a Python plugin in QGIS? Secondly, if yes, what am I doing wrong if I am getting the following error?
OSError: [WinError 126] The specified modul could not be found
The plugin was created using the plugin builder and following this tutorial. It's a dock widget and is besides the processing function vanilla.
What I tried so far:
- Checked if the .dll exists in the specified location
- Ran a mwe only loading the dll and doing the processing in both a conda environment and using the Python executable in c:\Program Files\QGIS 3.14\apps\Python37\ -> Both worked without problems
os.chdirand changed to directory where the .dll is located -> No effect
- Tried different things with the directory string (raw, forward slash, double backward slash)
- Added the directory containing the dll to the Windows
I've read that it could be related to a missing dependency. However, I'm not sure how to pin-point the problem as it seems to run in both tested Python environments.