MATLAB crashes when importing Numba

4 次查看(过去 30 天)
Jens Renders
Jens Renders 2021-3-14
回答: Imran 2022-11-7
When importing a Python file or trying to call a Python function from MATLAB, that relies on the Numba library, MATLAB crashes. The shortest way to reproduce this is to just import the Numba library:
>> py.importlib.import_module('numba');
The result is that the MATLAB process freezes and that it prints:
double free or corruption (out)
in the terminal from which I launched MATLAB. What causes this? Is this a MATLAB bug or is this expected?
I am using python 3.7.4, (miniconda) on Ubuntu 18.04

回答(1 个)

Imran
Imran 2022-11-7
Hello Jens,
I understand that you're facing MATLAB crashes when you're trying to import functions that relies on Numba library.
If MATLAB crashes when you try to use a function from a Python module, then this might be caused by a version conflict between libraries shipped by MATLAB and the ones required by the Python package you are trying to use. So first of all make sure the versions match.
The error message that you're getting generally comes due to MATLAB runtime cache corruption. In order to resolve this error you will need to remove your preferences directory:
For UNIX/Linux - Check in your home directory for a directory named .matlab and remove this and try re-launching MATLAB. This directory will get re-created at startup.
If this does not resolve the problem, some users have reported that setting the following variable may resolve the problem also:
set MALLOC_CHECK=0
I hope this helps.

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by