This installation command, other than the original one, has worked for me: python setup.py build --build-base=$(mktemp -d) install
ImportError: No module named matlab.engine
85 ビュー (過去 30 日間)
I could not seem to import matlab.engine in python in my Ubuntu 15 as shown in the following figure:
The MATLAB Engine API for Python has been successfully installed following the instructions here http://au.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html
Does anyone have a solution for this issue?
回答 (5 件)
Bo Li 2016 年 6 月 16 日
Anaconda may not work as MATLAB Engine API for Python supports CPython only:
Another issue to consider is whether your Python version support wide-Unicode:
Following code can be used to check it supports wide Unicode or not:
>>> import sys
>>> if sys.maxunicode > 65535:
... print 'wide-unicde'
... print 'narrow-unicode'
Anshul Joshi 2018 年 5 月 15 日
I had the same issue with mine. I am running Ubuntu 16.04 and Python 3.6 on Pycharm, and Matlab 2018a. After installing Matlab Python API as given on http://au.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html
it creates a folder structures like:
<installation-dir>/lib/ and <installation-dir>/lib.linux-x86-64-2.7/
or something like that. After I copied these directories into my Python project root they started working and I was able to import matlab.engine(). In Pycharm you can add source folders paths to your project; you can try something similar.