Home › Forum › SOFA › Programming with SOFA › SofaPython3: Troubles starting Sofa GUI from Python script
Tagged: 64_bits, Linux_ubuntu, Plugin_other, SOFA_other, SofaGUI, SofaPython3
- This topic has 5 replies, 4 voices, and was last updated 3 years, 9 months ago by
Scheikl.
-
AuthorPosts
-
19 October 2020 at 14:32 #17418
Jambouli
BlockedHello everyone,
I have started working with Sofa just recently. My aim is to use Sofa with the plugin SofaPython3. I managed to install everything (current master branch version), however when I try to run the example file SofaGui.py (from https://github.com/sofa-framework/SofaPython3/tree/master/examples) I get the following Warning:
[WARNING] [SofaViewer] Could not create file ‘…/SOFA_logo.bmp’
Valid extensions: ddsI converted the bmp file to a dds one, but the warning stays the same. Also the GUI pops up anyway, but when I try to run the same code with a simple createScene function it does not show the scene (the warning message is the same).
UPDATE: I found some mistakes in my createScene function, so now the GUI actually shows the scene. However the warning message did not disappear. Also when I try to take a screenshot within the script (using Sofa.Gui.GUIManager.SaveScreenshot) I get the message that there is no support found for bmp or png.
Does anyone have an idea how to fix this?Any help is highly appreciated,
Thank you in advance!26 October 2020 at 16:38 #17446Hugo
KeymasterDear @jacqueline
Welcome on the SOFA forum and my apologies for the answer delay!
The warning you are having comes from the fact that in SOFA image formats are not supported by default. To support bpm, png etc, you need to activate the CIMG plugin.Let me know if this helps.
Hugo
PS: important notice, the SofaPython3 plugin is still in alpha version. Use it with care and do not hesitate to report any issue. Thank you for your understanding.
29 October 2020 at 08:52 #17470Jambouli
BlockedDear Hugo,
thank you for your response. I will try it as soon, as I can. While experimenting with other versions I got some problems with the original one. Now I am trying to reinstall it.
Jacqueline
2 November 2020 at 16:32 #17519Jambouli
BlockedDear Hugo,
I finally managed to install Sofa with SofaPython3 again. However I get an error message when trying to import Sofa.Gui in python. I already installed the python bindings and Sofa, Sofa.Core, SofaRuntime and Sofa.Simulation can be imported without any problems.
The error message I get for Sofa.Gui:
ImportError: libSofaMiscForceField.so.20.06.99: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File “SofaGui.py”, line 15, in <module>
import Sofa.GuiDo you have an idea what I did wrong?
Thank you in advance,
Jacqueline7 December 2020 at 18:51 #17970AO
BlockedHello,
As @ScheicklP told me a few days ago you might want to type :
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:Mypath/sofa/build/lib
and retry.(with the correct path)
If it works you can add this line to your .bashrc file.Alban.
7 December 2020 at 18:53 #17971Scheikl
BlockedHi @jacqueline. 🙂
That is a Linker problem.
I fixed that by addingexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SOFA_ROOT/lib
to my environment (conda in my case). ($SOFA_ROOT should be your build dir. E.g. /home/yourname/sofa/build/v2006)).
Adding it to your .bashrc/.zshrc/… works aswell. 🙂Cheers,
Paul -
AuthorPosts
- You must be logged in to reply to this topic.