Anaconda install Matlab Engine on Linux

后端 未结 3 977
失恋的感觉
失恋的感觉 2020-12-11 05:59

I\'m trying to install Matlab Engine for Python on CentOS 7 for Matlab R2016a using anaconda python 3.4.

I executed the following commands:



        
相关标签:
3条回答
  • 2020-12-11 06:45

    After so many tortures I finally solved this in a simple way. Instead of configure system to use anaconda's python by modifying .bash_profile, you can add an alternative to python command:

      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
    
    0 讨论(0)
  • 2020-12-11 06:47

    Just a reminder for those who have multiple virtual envs under the anacodna folder, after doing python setup.py install --prefix="/Users/user/anaconda/" as prompted by @Leighton, the matlab engine package is actually installed under the separate anacodna3/lib/python2.7/site-package/matlab folder rather than the normal anaconda3/lib/python3.7/site-package. So you need to manually move that matlab folder to the site-package folder your python is using. If you have multiple virtual envs, move it to the corresponding site-package folder of the virtual env you will run program.

    0 讨论(0)
  • 2020-12-11 06:56
    cd "matlabroot\extern\engines\python"
    python setup.py install --prefix="installdir"
    

    For Unix (OSX10) python2.7, using Anaconda

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

    Here is the Matlab Document:

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

    0 讨论(0)
提交回复
热议问题