Anaconda instala el motor de Matlab en Linux

Estoy tratando de instalar Matlab Engine for Python en CentOS 7 para Matlab R2016a usando anaconda python 3.4.

Ejecuté los siguientes comandos:

 source activate py34 # Default is python 3.5 python setup.py install 

La salida es:

 running install running build running build_py running install_lib creating /root/.local/lib/python2.7/site-packages/matlab creating /root/.local/lib/python2.7/site-packages/matlab/_internal copying build/lib/matlab/_internal/mlarray_sequence.py -> /root/.local/lib/python2.7/site-packages/matlab/_internal copying build/lib/matlab/_internal/__init__.py -> /root/.local/lib/python2.7/site-packages/matlab/_internal copying build/lib/matlab/_internal/mlarray_utils.py -> /root/.local/lib/python2.7/site-packages/matlab/_internal copying build/lib/matlab/mlarray.py -> /root/.local/lib/python2.7/site-packages/matlab creating /root/.local/lib/python2.7/site-packages/matlab/engine copying build/lib/matlab/engine/engineerror.py -> /root/.local/lib/python2.7/site-packages/matlab/engine copying build/lib/matlab/engine/futureresult.py -> /root/.local/lib/python2.7/site-packages/matlab/engine copying build/lib/matlab/engine/fevalfuture.py -> /root/.local/lib/python2.7/site-packages/matlab/engine copying build/lib/matlab/engine/basefuture.py -> /root/.local/lib/python2.7/site-packages/matlab/engine copying build/lib/matlab/engine/matlabengine.py -> /root/.local/lib/python2.7/site-packages/matlab/engine copying build/lib/matlab/engine/__init__.py -> /root/.local/lib/python2.7/site-packages/matlab/engine copying build/lib/matlab/engine/enginesession.py -> /root/.local/lib/python2.7/site-packages/matlab/engine copying build/lib/matlab/engine/_arch.txt -> /root/.local/lib/python2.7/site-packages/matlab/engine copying build/lib/matlab/engine/matlabfuture.py -> /root/.local/lib/python2.7/site-packages/matlab/engine copying build/lib/matlab/mlexceptions.py -> /root/.local/lib/python2.7/site-packages/matlab copying build/lib/matlab/__init__.py -> /root/.local/lib/python2.7/site-packages/matlab byte-compiling /root/.local/lib/python2.7/site-packages/matlab/_internal/mlarray_sequence.py to mlarray_sequence.pyc byte-compiling /root/.local/lib/python2.7/site-packages/matlab/_internal/__init__.py to __init__.pyc byte-compiling /root/.local/lib/python2.7/site-packages/matlab/_internal/mlarray_utils.py to mlarray_utils.pyc byte-compiling /root/.local/lib/python2.7/site-packages/matlab/mlarray.py to mlarray.pyc byte-compiling /root/.local/lib/python2.7/site-packages/matlab/engine/engineerror.py to engineerror.pyc byte-compiling /root/.local/lib/python2.7/site-packages/matlab/engine/futureresult.py to futureresult.pyc byte-compiling /root/.local/lib/python2.7/site-packages/matlab/engine/fevalfuture.py to fevalfuture.pyc byte-compiling /root/.local/lib/python2.7/site-packages/matlab/engine/basefuture.py to basefuture.pyc byte-compiling /root/.local/lib/python2.7/site-packages/matlab/engine/matlabengine.py to matlabengine.pyc byte-compiling /root/.local/lib/python2.7/site-packages/matlab/engine/__init__.py to __init__.pyc byte-compiling /root/.local/lib/python2.7/site-packages/matlab/engine/enginesession.py to enginesession.pyc byte-compiling /root/.local/lib/python2.7/site-packages/matlab/engine/matlabfuture.py to matlabfuture.pyc byte-compiling /root/.local/lib/python2.7/site-packages/matlab/mlexceptions.py to mlexceptions.pyc byte-compiling /root/.local/lib/python2.7/site-packages/matlab/__init__.py to __init__.pyc running install_egg_info Writing /root/.local/lib/python2.7/site-packages/matlabengineforpython-R2016a-py2.7.egg-info 

De alguna manera, instala el motor matlab en la versión python del sistema que no py34 la env. Virtual py34 de anaconda. ¡Noté esto en OSX y funciona en mi mac! ¿Alguien puede ayudar con esto en CentOS?

 cd "matlabroot\extern\engines\python" python setup.py install --prefix="installdir" 

Para Unix (OSX10) python2.7, usando Anaconda

 cd /Applications/MATLAB_R2015a.app/extern/engines/python python setup.py install --prefix="/Users/user/anaconda/" 

Aquí está el documento de Matlab:

https://www.mathworks.com/help/matlab/matlab_external/install-matlab-engine-api-for-python-in-nondefault-locations.html

Después de tantas torturas, finalmente resolví esto de una manera simple. En lugar de configurar el sistema para usar python de anaconda modificando .bash_profile, puede agregar una alternativa al comando python:

  sudo update-alternatives --install /usr/bin/python python ~/anaconda3/envs/py34/bin/python 2 update-alternatives --display python cd /usr/local/MATLAB/R2016a/extern/engines/python/ sudo python setup.py install