Mehar Charan Sahai
Mehar Charan Sahai

Reputation: 183

Linux[Ubuntu 16.04]-Installing MATLAB engine for Anaconda Python3

I'm trying to get Matlab's python engine to work with my Anaconda installation on Linux. But I'm not quite getting it right.

Anaconda's Python version: 3.6 (created a virtual-env for python 3.4)

Matlab Version: 2016b

Path to matlab root: /usr/local/MATLAB

Path to Anaconda: /home/fire-trail/anaconda3

Virtual env: py34

I installed matlab engine via official documentation from mathworks but it installs it in the default Linux Python installation and that too in Python 2.7

I want Anaconda 3.4 virtual env (py34) to find matlab engine.

Upvotes: 2

Views: 663

Answers (1)

Mehar Charan Sahai
Mehar Charan Sahai

Reputation: 183

Did it myself. Just copied the matlab folder which was formed in matlab directory for py2.7 to my anaconda's virtual-env's site-packages.

According to the paths mentioned above in question, you need to do this on linux terminal.

cp /usr/local/MATLAB/R2016a/extern/engines/python/build/lib.linux-x86_64-2.7/matlab /home/fire-trail/anaconda3/envs/py34/lib/python3.4

and it will work with py34 in anaconda.

remember that min requirement for matlab engine in linux is, matlab 2014b and python 2.7

hope this helps other.

Upvotes: 1

Related Questions