Running Matlab using Python gives 'No module named matlab.engine' error -
i trying run matlab code using python. tried follow instructions given on mathworks page.
when trying import matlab though python, installed using pip install matlab
.
however, importing matlab.engine
gives error no module named 'matlab.engine'; 'matlab' not package
. cannot installed using pip install engine
either.
how can code running? python code i'm running below:
import matlab.engine eng = matlab.engine.start_matlab() eng.triarea(nargout=0)
python version - 3.5
matlab version - 8.5.0.197613 (r2015a)
you need install matlab engine python, , cannot installed using pip. try instructions listed here. have listed instructions briefly below:
- make sure have python in path.
- find matlab root folder. can use
matlabroot
command within matlab find it. - go matlab root folder in command line.
cd "matlabroot\extern\engines\python"
(in windows)python setup.py install
Comments
Post a Comment