"No module named 'libmwbuffer'" error when converting to numpy
31 次查看(过去 30 天)
显示 更早的评论
I am trying to convert an array into numpy, but I keep getting this issue:
Python Error: ModuleNotFoundError: No module named 'libmwbuffer'
Python function '' might not be able to accept input argument at position 1. The function may require a specific
data type that you can construct from the MATLAB array. For more information, see the documentation for Python
function '' and working with Python arrays.
I checked and I have this pyversion, which is supposed to be compatible with Matlab R2024a. what's the issue?
version: '3.9'
executable: 'C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.EXE'
library: 'C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python39.dll'
home: 'C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3'
isloaded: 1
I tried multiple different versions of numpy save
py.numpy.save(output_filename, data);
or
py.numpy.save(strcat(output_filename, '.npy'), py.numpy.array(data));
or
py.numpy.save(strcat(output_filename, '.npy'), data);
0 个评论
回答(1 个)
Venkat Siddarth Reddy
2024-10-19
Hi Alvin,
It seems like there is a compatibility issue between MATLAB and the "numpy" Python library version.
To resolve this issue, you can configure MATLAB to execute all Python scripts in a separate MATLAB-independent OS process, rather than the default execution behavior where all Python scripts are executed in the same OS process as MATLAB.
To configure MATLAB to execute the Python scripts in a separate process, please execute the following command in "MATLAB Command Window":
pyenv(ExecutionMode="OutOfProcess");
To learn more about "Execution Modes" of Python script in MATLAB, please refer to the following documentation:
I hope it helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call Python from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!