Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sofa.Gui crashes when importing into a runSofa executable (embed interpreted) #102

Open
jnbrunet opened this issue Jan 22, 2021 · 1 comment
Labels
issue: bug Something isn't working
Milestone

Comments

@jnbrunet
Copy link
Contributor

jnbrunet commented Jan 22, 2021

For some reason, this only happen when using a packaged version of SOFA (i.e. not build install by ourself).

To reproduce:

  1. Download the latest SOFA v20.12 package
  2. Create this simple scene file and do not put it inside the directory from which runSofa will run, but use instead a different folder:
    test/test.py
# test/test.py
import Sofa.Gui
def createScene(root):
    pass
  1. Run it using runSofa, for example: runSofa -l libSofaPython3.so test/test.py
  2. This happens:
[ERROR]   [SofaPython3::SceneLoader] ModuleNotFoundError: No module named 'Sofa.Gui'

At:
  test.py(1): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(728): exec_module
  <frozen importlib._bootstrap>(677): _load_unlocked
  <frozen importlib._bootstrap>(696): _load
  /usr/lib/python3.7/imp.py(171): load_source
  /usr/lib/python3.7/imp.py(234): load_module
  <string>(3): <module>

Moreover, everything is fine (i.e. the bug isn't present) if runSofa is ran from the same directory as the scene file. For example, running runSofa -l libSofaPython3.so test.py instead of runSofa -l libSofaPython3.so test/test.py

@jnbrunet jnbrunet added the issue: bug Something isn't working label Jan 22, 2021
@jnbrunet jnbrunet added this to the V21.06 milestone Jan 22, 2021
@RyanPaulMcKenna
Copy link

RyanPaulMcKenna commented May 20, 2024

[INFO] [PluginManager] Loaded plugin: /home/ozwald/sofa/build/v23.12/install/lib/libSofa.GL.C
omponent.Shader.so
At:
/usr/lib/python3/dist-packages/numpy/core/init.py(49):
(241): _call_with_frames_removed
(883): exec_module
(703): _load_unlocked
(1006): _find_and_load_unlocked
(1027): _find_and_load
(241): _call_with_frames_removed
(1079): _handle_fromlist
/usr/lib/python3/dist-packages/numpy/init.py(142):
(241): _call_with_frames_removed
(883): exec_module
(703): _load_unlocked
(1006): _find_and_load_unlocked
(1027): _find_and_load
(241): _call_with_frames_removed
(992): _find_and_load_unlocked
(1027): _find_and_load
(241): _call_with_frames_removed
(992): _find_and_load_unlocked
(1027): _find_and_load
/home/ozwald/sofa/build/v23.12/install/plugins/SofaPython3/share/SofaPython3/examples/liver.py(29): createScene

SofaPython3 is loaded fine but when I try to run any of the examples nothing loads in the simulator it is just blank, running the animation does nothing. It is as if nothing is being loaded. And I get the above error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants