When trying
import yarp (or idyntree)
with Blender with python > 3.8, if you installed the bindings via conda you get this error:
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "C:\Users\ngenesio\AppData\Local\mambaforge\envs\robotologyenv\Lib\site-packages\yarp.py", line 15, in <module>
import _yarp
ImportError: DLL load failed while importing _yarp: The specified module could not be found.
This is due to the fact that from Python 3.8 it changed basically how the DLL are loaded, see ref.
This problem is fixed if before import you call:
os.add_dll_directory("%CONDA_PREFIX%\\Library\\bin")
with %CONDA_PREFIX% expanded.
The best solution would be add to the script something like ROS2 bindings see ref
cc @traversaro