sofa icon indicating copy to clipboard operation
sofa copied to clipboard

fail to load SofaPython3

Open doudou533 opened this issue 3 years ago • 2 comments

[ERROR] [PluginManager] Plugin loading failed (/home/dou/Downloads/SOFA_robosoft2022_python-3.9_Linux/plugins/SofaPython3/lib/libSofaPython3.so): libpython3.9.so.1.0: cannot open shared object file: No such file or directory

doudou533 avatar Jul 30 '22 04:07 doudou533

I was able to reproduce this issue, when compiling Sofa and SofaPython3 in Debug mode.

When trying to add libSofaPython3.so through the PluginManager, it first warns the user, that the .so was compiled in debug mode, while Sofa was compiled in Release mode (which is incorrect). Then, on adding the library, the above mentioned error is printed.

I confirmed with ldd libSofaPython3.so that libpython3.9.so.1.0 is actually not found. In Release mode, it also does not find it, but does not seem to care.

When adding the path to libpython3.9.so.1.0 to the LD_LIBRARY_PATH, it finds it, but SofaRuntime is missing required functions/attributes. In Release

>>> dir(SofaRuntime)
['DataRepository', 'PluginRepository', 'Sofa', 'SofaRuntime', 'Timer', '__SofaPythonEnvironment_importedModules__', '__SofaPythonEnvironment_modulesExcludedFromReload', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'formatStackForSofa', 'getCategories', 'getPythonCallingPoint', 'getPythonCallingPointAsString', 'getSofaFormattedStringFromException', 'getStackForSofa', 'importPlugin', 'importlib', 'init', 'inspect', 'os', 'sendMessageFromException', 'sofaExceptHandler', 'sofaFormatHandler', 'sys', 'traceback', 'unloadModules']

In Debug, only 'DataRepository', 'PluginRepository' are present (error is thrown, that unloadModules is missing).

ScheiklP avatar Aug 09 '22 09:08 ScheiklP

Now I also have this issue for Release build on v22.06.00 of SOFA and v22.06 of SofaPython3.

@guparan Is there a CI check for loading a SofaPython3 scene after a fresh SOFA build in either SOFA or SofaPython3 repo?

ScheiklP avatar Aug 11 '22 22:08 ScheiklP