ImportError: No module named matlab.engine

조회 수: 82(최근 30일)
KIEN NGUYEN 2016년 6월 16일
댓글: uchiha 2020년 3월 20일
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
Does anyone have a solution for this issue?


KIEN NGUYEN 2016년 6월 17일
This installation command, other than the original one, has worked for me: python build --build-base=$(mktemp -d) install
  댓글 수: 4
Nicolás Ugrinovic
Nicolás Ugrinovic 2020년 2월 14일
nice, thanks!

댓글을 달려면 로그인하십시오.

Bo Li
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'
... else:
... print 'narrow-unicode'

Anshul Joshi
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
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.
  댓글 수: 4
Hongbin Liu
Hongbin Liu 2018년 7월 22일
편집: Hongbin Liu 2018년 7월 22일
I have addressed my problem. I found that the Python could not find the Matlab module because my computer had two Python versions. Therefore, I pointed out the Python version when the API was installed, i.e. the installing code was changed as
python3 install
Best regards and thanks again.

댓글을 달려면 로그인하십시오.

Farzadd Amirjavidd
Farzadd Amirjavidd 2019년 1월 9일
There is a full answer to this question for windows 10 64 bit and Pycharm :

Ankit Jaiswal
Ankit Jaiswal 2020년 1월 8일
I had same issue. I was trying it on Spyder but it didn't work. I rhen shifted to Pycharm and the error was gone. I guess there is some issue with Anaconda-Spyder.
  댓글 수: 1
uchiha 2020년 3월 20일
Cannot get this to work, could you explain what you did in pycharm?

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by