- https://www.mathworks.com/help/releases/R2020b/matlab/matlab_external/install-the-matlab-engine-for-python.html
- https://www.mathworks.com/help/releases/R2020b/matlab/matlab_external/install-matlab-engine-api-for-python-in-nondefault-locations.html
Matlab Engine for Python: Import Error: cannot import name "double" from "mlarray"
조회 수: 8 (최근 30일)
이전 댓글 표시
Trying to use Matlab engine for python with pyqtgraph for real-time data display.
The matlab version is R2020b and I am on Windows
I can't post the actual code, but in the python file I am using the engine in, I create an instance of a class and repeatedly call a method that gets data from that class and then I want to plot that data.
I am considering trying this on R2022b if I have no luck with R2020b for this application.
Here is the ful llist of exceptions raised by python, I have removed the first part of the absolute path, but each begins at the root of the python virtual environment directory:
- Traceback (most recent call last):
- File "lib\site-packages\pyqtgraph\multiprocess\remoteproxy.py", line 224, in handleRequest
- opts = pickle.loads(optStr)
- File "lib\site-packages\matlab\mlarray.py", line 31, in <module>
- from _internal.mlarray_sequence import _MLArrayMetaClass
- File "lib\site-packages\matlab\_internal\mlarray_sequence.py", line 3, in <module>
- from _internal.mlarray_utils import _get_strides, _get_size, \
- File "lib\site-packages\matlab\_internal\mlarray_utils.py", line 8, in <module>
- import matlab
- File "lib\site-packages\matlab\__init__.py", line 24, in <module>
- from mlarray import double, single, uint8, int8, uint16, \
- ImportError: cannot import name 'double' from 'mlarray' (lib\site-packages\matlab\mlarray.py)
댓글 수: 0
답변 (1개)
Nihal Reddy
2023년 2월 15일
This is likely due to MATLAB Engine not being installed correctly. Please see the below documentation references:
In particular, make sure that you call the installation script with the version of Python you intend to use and that your Python path is updated accordingly.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Call MATLAB from Python에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!