I’m somewhat new to OTB and am trying to utilize the OTB python package in pyqgis. I have OTB properly installed and configured in the QGIS processing toolbox. When I attempt to import the library into Pyqgis I get the following error:
I think that you have to give the correct environment to the pyqgis interpreter, usualy, to import otbApplication you have to call the otbenv.bat (which is in the otb install folder) before. This script sets the correct environment variable for the import to work. I don’t know the pyqgis interpreter, maybe in the options you can call a .bat script before or give it as input of pyqgis interpreter?
I’ve tried running the otbenv.bat file using os and subprocess modules in the script but I’m still unable to import the module into pyqgis. I’m going to keep trying a few other things and will make sure to update the thread once I find the solution.