How to install Matlab Jupyter engine on macOS

16 views (last 30 days)
Glen
Glen on 31 May 2019
Answered: Mike Croucher on 1 Mar 2023
I'm trying to get the jupyter MATLAB engine to install. I've folowed every web tutorial I can find. None of them seem to work.
My situation:
  • I have MATLAB 2019a
  • I'm on macOS 10.14.3
  • I'd vastly prefer to use the stock macOS python, which is python 2.7. I find python version control to be hellish. I don't develop in python and, hence, don't intentionally have any anaconda environments installed. I don't understand anaconda and have no reason to learn it.
I have run the following:
cd /Applications/MATLAB_R2019a.app/extern/engines/python/
python setup.py build --build-base=$(mktemp -d) install
which seems to run fine:
running build
running build_py
creating /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib
creating /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab
copying dist/matlab/mlarray.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab
copying dist/matlab/__init__.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab
copying dist/matlab/mlexceptions.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab
creating /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/engine
copying dist/matlab/engine/fevalfuture.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/engine
copying dist/matlab/engine/matlabengine.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/engine
copying dist/matlab/engine/basefuture.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/engine
copying dist/matlab/engine/__init__.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/engine
copying dist/matlab/engine/matlabfuture.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/engine
copying dist/matlab/engine/futureresult.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/engine
copying dist/matlab/engine/enginehelper.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/engine
copying dist/matlab/engine/engineerror.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/engine
copying dist/matlab/engine/enginesession.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/engine
creating /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/_internal
copying dist/matlab/_internal/mlarray_sequence.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/_internal
copying dist/matlab/_internal/mlarray_utils.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/_internal
copying dist/matlab/_internal/__init__.py -> /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/_internal
running install
running install_lib
copying /var/folders/_4/z98cxbw12vzgf5859kpmr_vr0000gq/T/tmp.chM8aBXz/lib/matlab/engine/_arch.txt -> /usr/local/lib/python2.7/site-packages/matlab/engine
running install_egg_info
Removing /usr/local/lib/python2.7/site-packages/matlabengineforpython-R2018a-py2.7.egg-info
Writing /usr/local/lib/python2.7/site-packages/matlabengineforpython-R2018a-py2.7.egg-info
However, when I list the directory I get:
build dist setup.py
I have jupyter set up via launchctl. When try to start jupyter I get:
sudo launchctl load jupyter
Password:
/Applications/MATLAB_R2019a.app/extern/engines/python/jupyter: No such file or directory
And when I run a jupyter session, I see matlab as an available kernel, but the kernel dies when I start a new notebook.
Any ideas?

Answers (2)

LeChat
LeChat on 18 Feb 2020
Try this short tutorial that I posted a couple years ago:
Hope this helps :)

Mike Croucher
Mike Croucher on 1 Mar 2023
MathWorks have now released a MATLAB Kernel for Jupyter. You should find this easier to use! Official MathWorks MATLAB kernel for Jupyter released » The MATLAB Blog - MATLAB & Simulink

Categories

Find more on Integration with Online Platforms in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!