Skip to content

Import numpy error while opening .py file #460

@fgmelo14

Description

@fgmelo14

Hello!
I am using the SOFA_v24.06.00_MacOS binaries with python3.10

I am trying to get started using the SofaPython3 plugin but I am facing some errors. I run RunSofa and I get no problem; SofaPython3 loads correctly.

As a simple test, when I load into runSofa a simple python script with only "import numpy" I get the following error:

[DEPRECATED] [SofaPython3::SceneLoader] Unable to completely load the scene from file '/Users/digitalsurgerylab/Downloads/test.py'.  
Python exception:   
  ImportError: Error importing numpy: you should not try to import numpy from
        its source directory; please exit the numpy source tree, and relaunch
        your python interpreter from there.

At:
  /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/__init__.py(135): <module>
  <frozen importlib._bootstrap>(241): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(883): exec_module
  <frozen importlib._bootstrap>(703): _load_unlocked
  <frozen importlib._bootstrap>(1006): _find_and_load_unlocked
  <frozen importlib._bootstrap>(1027): _find_and_load
  /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/scipy/__init__.py(47): <module>
  <frozen importlib._bootstrap>(241): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(883): exec_module
  <frozen importlib._bootstrap>(703): _load_unlocked
  <frozen importlib._bootstrap>(1006): _find_and_load_unlocked
  <frozen importlib._bootstrap>(1027): _find_and_load
  /Users/digitalsurgerylab/Downloads/test.py(12): <module>
  <frozen importlib._bootstrap>(241): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(883): exec_module
  <string>(6): <module>

Any help fixing this would be greatly appreciated!
Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions