sofa-framework / sofa

Real-time multi-physics simulation with an emphasis on medical simulation.
https://www.sofa-framework.org
GNU Lesser General Public License v2.1
934 stars 312 forks source link

No module named 'numpy.core._multiarray_umath' #5088

Closed AndreaCusinato closed 3 weeks ago

AndreaCusinato commented 3 weeks ago

Problem

Description Good morning, I have a problem with @ScheiklP's sofa_env test code. When I try to run python3 sofa_env/scenes/controllable_object_example/controllable_env.py I get

Traceback (most recent call last): File "C:\SOFA\Lib\site-packages\numpy\core__init__.py", line 24, in from . import multiarray File "C:\SOFA\Lib\site-packages\numpy\core\multiarray.py", line 10, in from . import overrides File "C:\SOFA\Lib\site-packages\numpy\core\overrides.py", line 8, in from numpy.core._multiarray_umath import ( ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\SOFA\Lib\site-packages\numpy__init.py", line 144, in from numpy.config__ import show as show_config File "C:\SOFA\Lib\site-packages\numpy__config.py", line 4, in from numpy.core._multiarray_umath import ( File "C:\SOFA\Lib\site-packages\numpy\core\init__.py", line 50, in raise ImportError(msg) ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\sofa_env\sofa_env\scenes\controllable_object_example\controllable_env.py", line 1, in import gymnasium.spaces as spaces File "C:\SOFA\Lib\site-packages\gymnasium__init.py", line 5, in from gymnasium.core import ( File "C:\SOFA\Lib\site-packages\gymnasium\core.py", line 8, in import numpy as np File "C:\SOFA\Lib\site-packages\numpy\init__.py", line 149, in raise ImportError(msg) from e 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.

I already checked the suggested troubleshooting, but I couldn't fix the error. Can you help me? Thank you!

Steps to reproduce py -3.11 -m venv C:/SOFA SOFA\Scripts\Activate git clone https://github.com/ScheiklP/sofa_env.git cd sofa_env pip install -e . python3 sofa_env/scenes/controllable_object_example/controllable_env.py

Expected behavior I would have expected that no errors would appear


Environment

Context

Command called


python3 sofa_env/scenes/controllable_object_example/controllable_env.py

Env vars


import sys
print(sys.path)
['', 'C:\\Users\\JetsLab\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\idlelib', 'C:\\SOFA\\Lib\\site-packages', 'C:\\Users\\JetsLab\\AppData\\Local\\Programs\\Python\\Python311\\python311.zip', 'C:\\Users\\JetsLab\\AppData\\Local\\Programs\\Python\\Python311\\Lib', 'C:\\Users\\JetsLab\\AppData\\Local\\Programs\\Python\\Python311\\DLLs', 'C:\\Users\\JetsLab\\AppData\\Local\\Programs\\Python\\Python311', 'C:\\Users\\JetsLab\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages']

Logs

Full output


Traceback (most recent call last):
  File "C:\SOFA\Lib\site-packages\numpy\core\__init__.py", line 24, in <module>
    from . import multiarray
  File "C:\SOFA\Lib\site-packages\numpy\core\multiarray.py", line 10, in <module>
    from . import overrides
  File "C:\SOFA\Lib\site-packages\numpy\core\overrides.py", line 8, in <module>
    from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\SOFA\Lib\site-packages\numpy\__init__.py", line 144, in <module>
    from numpy.__config__ import show as show_config
  File "C:\SOFA\Lib\site-packages\numpy\__config__.py", line 4, in <module>
    from numpy.core._multiarray_umath import (
  File "C:\SOFA\Lib\site-packages\numpy\core\__init__.py", line 50, in <module>
    raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.10 from "C:\Users\JetsLab\.pyenv\pyenv-win\versions\3.10.11\python3.exe"
  * The NumPy version is: "1.26.4"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\sofa_env\sofa_env\scenes\controllable_object_example\controllable_env.py", line 1, in <module>
    import gymnasium.spaces as spaces
  File "C:\SOFA\Lib\site-packages\gymnasium\__init__.py", line 5, in <module>
    from gymnasium.core import (
  File "C:\SOFA\Lib\site-packages\gymnasium\core.py", line 8, in <module>
    import numpy as np
  File "C:\SOFA\Lib\site-packages\numpy\__init__.py", line 149, in <module>
    raise ImportError(msg) from e
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.