2
$\begingroup$

I just upgraded to Blender 4.1 (Windows) and my addons, which say they work with 4.1, all fail because of a missing numpy.core._multiarray.umath.
I don't know how to use Python or NumPy, but I can see in the Blender folder that the "multiarray umath" file is there, and both Python and NumPy are the versions Blender says they should be.
I tried installing Python 3.11, Pip, and then NumPy on my computer and copying the files, but that did nothing. I assume it's a version issue with Python or NumPy since it works in 4.0.

I'll copy the error code below:

Traceback (most recent call last):
  File "C:\Users\me\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\modules\numpy\core\__init__.py", line 24, in <module>
    from . import multiarray
  File "C:\Users\me\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\modules\numpy\core\multiarray.py", line 10, in <module>
    from . import overrides
  File "C:\Users\me\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\modules\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:\Users\me\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\modules\numpy\__init__.py", line 144, in <module>
    from numpy.__config__ import show as show_config
  File "C:\Users\me\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\modules\numpy\__config__.py", line 4, in <module>
    from numpy.core._multiarray_umath import (
  File "C:\Users\me\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\modules\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.11 from "C:\Program Files\Blender Foundation\Blender 4.1\4.1\python\bin\python.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:\Program Files\Blender Foundation\Blender 4.1\4.1\scripts\modules\addon_utils.py", line 376, in enable
    mod = importlib.import_module(module_name)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Blender Foundation\Blender 4.1\4.1\python\Lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\me\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\sectionbox\__init__.py", line 78, in <module>
    modules = get_all_submodules(Path(__file__).parent)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\sectionbox\__init__.py", line 44, in get_all_submodules
    return list(iter_submodules(directory, directory.name))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\me\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\sectionbox\__init__.py", line 49, in iter_submodules
    mod = importlib.import_module("." + name, package_name)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Blender Foundation\Blender 4.1\4.1\python\Lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\me\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\sectionbox\handlers.py", line 4, in <module>
    from .utils.draw_handles import DrawHandles
  File "C:\Users\me\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\sectionbox\utils\draw_handles.py", line 3, in <module>
    import numpy as np
  File "C:\Users\me\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\modules\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.
$\endgroup$
12
  • $\begingroup$ Hello. numpy comes bundled within the installation of Blender, you don't need to install it in your addon folder. I would try deleting C:\Users\me\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\modules\numpy and launching blender again (Make a backup beforehand) $\endgroup$
    – Gorgious
    Commented Apr 12 at 6:38
  • $\begingroup$ Same problem here. My addon relies on numpy, and it works completely fine with Blender 4.0. However, when using Blender 4.1, I get the same error. Any news? $\endgroup$
    – Alex Mekx
    Commented May 6 at 8:14
  • $\begingroup$ @AlexMekx Can you try this code: pastebin.com/Mr4RkT5b does it give you the same error? What numpy version are you using? print(np.__version__) and what python version print(sys.version). Mine is 1.24.3 and 3.11.7 respectively and it works fine on Blender 4.1.1. Try using that version or higher. $\endgroup$
    – Harry McKenzie
    Commented Jun 18 at 2:01
  • $\begingroup$ @HarryMcKenzie I tried the code, and I got the same error. My system is currently working with python version 3.10.1 and numpy 1.26.4. I haven't tried to update the python version because the author of this post already tried and said that did not work. Also, Blender actually uses 3.11.7 so I am not sure if this could really be the issue (please note I haven't tried to update my system python version because afraid of compatibility issues,...). Do you think that having a python sys version 3.10.1 could be the issue? Even tough Blender itself uses 3.11.7? $\endgroup$
    – Alex Mekx
    Commented Jun 18 at 11:25
  • $\begingroup$ I just realized that the numpy version installed in the Blender folder is 1.24.3. The one I have in my system is 1.26.4. $\endgroup$
    – Alex Mekx
    Commented Jun 18 at 11:28

1 Answer 1

1
+50
$\begingroup$

Blender 4.1 is Python 3.11 and Blender 4.0 is Python 3.10. If you have transferred the user preferences using Load Blender 4.0 Settings in the pop-up on the first opening of the new Blender version the AppData\...\scripts\modules also got copied and it can be incompatible between Python 3.11 and Python 3.10 and certainly is for numpy as it is a compiled library. The error is that while importing numpy it cannot find a suitable umath module for 3.11 which is _multiarray_umath.cp311-win_amd64.pyd.

enter image description here

Your option is to delete or move AppData\...\4.1\scripts\modules or the whole AppData\...\4.1 and possibly reinstall some addons.

Besides that Blender has its own numpy and does not need to be installed.

A related discussion about AppData\...\scripts. Simply put, anything inside AppData\Roaming\Blender Foundation\Blender\<VERSION>\ should not be version dependent as it gets copied on importing the previous version's settings.

A test simulating the issue.

Python 3.10.13 (main, Sep 20 2023, 07:33:17) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', 'C:\\Users\\user\\source\\python', 'C:\\blender\\blender-4.0.0-beta+v40.1f0520034acd-windows.amd64-release\\4.0\\python\\bin', 'C:\\blender\\blender-4.0.0-beta+v40.1f0520034acd-windows.amd64-release\\4.0\\python\\bin\\python310.zip', 'C:\\blender\\blender-4.0.0-beta+v40.1f0520034acd-windows.amd64-release\\4.0\\python\\DLLs', 'C:\\blender\\blender-4.0.0-beta+v40.1f0520034acd-windows.amd64-release\\4.0\\python\\lib', 'C:\\Users\\user\\AppData\\Roaming\\Python\\Python310\\site-packages', 'C:\\blender\\blender-4.0.0-beta+v40.1f0520034acd-windows.amd64-release\\4.0\\python', 'C:\\blender\\blender-4.0.0-beta+v40.1f0520034acd-windows.amd64-release\\4.0\\python\\lib\\site-packages']
>>> sys.path.pop(-1)
'C:\\blender\\blender-4.0.0-beta+v40.1f0520034acd-windows.amd64-release\\4.0\\python\\lib\\site-packages'
>>> sys.path.pop(-2)
'C:\\Users\\user\\AppData\\Roaming\\Python\\Python310\\site-packages'
>>> import importlib
>>> importlib.invalidate_caches()
>>> sys.path.insert(0, r"C:\blender\blender-4.1.0-alpha+main.bd51bb7623b0-windows.amd64-release\4.1\python\lib\site-packages")
>>> import numpy
Traceback (most recent call last):
  File "C:\blender\blender-4.1.0-alpha+main.bd51bb7623b0-windows.amd64-release\4.1\python\lib\site-packages\numpy\core\__init__.py", line 23, in <module>
    from . import multiarray
  File "C:\blender\blender-4.1.0-alpha+main.bd51bb7623b0-windows.amd64-release\4.1\python\lib\site-packages\numpy\core\multiarray.py", line 10, in <module>
    from . import overrides
  File "C:\blender\blender-4.1.0-alpha+main.bd51bb7623b0-windows.amd64-release\4.1\python\lib\site-packages\numpy\core\overrides.py", line 6, 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 "<stdin>", line 1, in <module>
  File "C:\blender\blender-4.1.0-alpha+main.bd51bb7623b0-windows.amd64-release\4.1\python\lib\site-packages\numpy\__init__.py", line 141, in <module>
    from . import core
  File "C:\blender\blender-4.1.0-alpha+main.bd51bb7623b0-windows.amd64-release\4.1\python\lib\site-packages\numpy\core\__init__.py", line 49, 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:\blender\blender-4.0.0-beta+v40.1f0520034acd-windows.amd64-release\4.0\python\bin\python.exe"
  * The NumPy version is: "1.24.3"

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'
$\endgroup$
1
  • $\begingroup$ Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on Blender Meta, or in Blender Chat. Comments continuing discussion may be removed. $\endgroup$
    – Harry McKenzie
    Commented Jun 19 at 8:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .