"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!