I would like to use the orfeo-toolbox via the QGIS Python Console, however, I don't seem to be able to import the otbApplication. I keep getting the following error:
import otbApplication
Traceback (most recent call last):
File "C:\OTB\lib\python3\otbApplication.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "C:\OSGEO4~1\apps\Python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
File "<frozen importlib._bootstrap>", line 583, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1043, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\OSGEO4~1\apps\Python37\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "<input>", line 1, in <module>
File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 737, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OTB\lib\python3\otbApplication.py", line 17, in <module>
_otbApplication = swig_import_helper()
File "C:\OTB\lib\python3\otbApplication.py", line 16, in swig_import_helper
return importlib.import_module('_otbApplication')
File "C:\OSGEO4~1\apps\Python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: The specified module could not be found.
I am using a Windows 10 computer and QGIS 3.8.2. I downloaded OTB 6.6.1, cloned the qgis-otb-plugin, and configured the environment variables as described in the Orfeo Toolbox Cookbook and various other resources.
I can use the OTB tools in the QGIS GUI, but not import it into the QGIS Python Console.