IPython/Jupyter notebooks on Mac

Hi,

I am trying to use ipython notebooks with MantidPlot on an Apple Macintosh computer. In the instructions you state that you need to import from the installation directory. Where is the directory located on a mac ? Is it hidden ?

Should this be the MantidPlot directory and as I use Jupyter notebooks can I just use this and ignore the ipython notebook included?

Thanks

Steven

import sys
sys.path.append(‘path/to/mantid/installation/directory’)
from mantid.simpleapi import *

Hi Steven,

You can use Jupyter or IPython notebooks with Mantid. I have updated the IPython Notebook page on the wiki to be a little clearer how to put the right module directory in so that Python can find mantid.

Please let me know if this stills needs further clarification.

Martyn

Hi,

I tried

import sys
sys.path.append(’/Applications/MantidPlot.app/Contents/MacOS’)
import mantid.simpleapi as sapi

On Jupyter notebooks but get a dead kernel

Does it work inside a standard Python interpreter from the command line?

Do you get any error messages or any sort of output?

It crashes python as well - goes to RESTART

Steven,

My gut feeling here is that you are not using the system Python, is that correct? What does

which python

give you? Mantid is compiled against system python (version 2.7) and won’t work with anything installed via a different mechanism.

Which python does not work

print (sys.version)

gives

2.7.10 |Anaconda 2.3.0 (x86_64)| (default, May 28 2015, 17:04:42)

Anaconda Python will not work unfortunately, only the Python installed at /usr/bin/python will currently work.