13
$\begingroup$

Nteract is a nice desktop client for jupyter kernels:

enter image description here

Now that we have the Jupyter Client for Wolfram, I'm wondering how Nteract could be connected to the free Wolfram engine?

$\endgroup$
9
+100
$\begingroup$

Update 20190705

Given the popularity of this question, it might be good to know why the OP (and possibly many others) didn't get WL running under Jupyter. So I provide the recipe below (all below tested under macOS):

1. Inspect the installed kernels:

By running

jupyter kernelspec list

One would see:

python3                /Users/sunt05/Library/Jupyter/kernels/python3
wlengine               /Users/sunt05/Library/Jupyter/kernels/wlengine
wolframlanguage12      /Users/sunt05/Library/Jupyter/kernels/wolframlanguage12

So we know the kernels are correctly installed (here I have both Mathematica and WLE).

2. Explore the kernel spec file:

By navigating into one of the above folders, one may see the magic happens right in the kernel.json file.

The one below is for WL:

{
    "argv":[
        "/Applications/Wolfram Engine.app/Contents/Resources/Wolfram Player.app/Contents/MacOS/WolframKernel",
        "-script",
        "\/Users\/sunt05\/Downloads\/WolframLanguageForJupyter-master\/WolframLanguageForJupyter\/Resources\/KernelForWolframLanguageForJupyter.wl",
        "{connection_file}",
        "ScriptInstall"
    ],
    "display_name":"Wolfram Language 12 WL",
    "language":"Wolfram Language"
}

So if the kernel spec is not properly installed, one can also manually create a such kernel json file and put the info of WLE in.

Hope this might be helpful.


Simply install the kernel for the Jupyter environment following the official guide: https://github.com/WolframResearch/WolframLanguageForJupyter

then WL would be there (tested on macOS with Anaconda Python 3.7.3):

enter image description here

A noting caveat is that the auto-completion is missing.

Environment info:

conda version : 4.6.14
conda-build version : 3.17.8
python version : 3.7.3.final.0
$\endgroup$
  • $\begingroup$ My kernel.json was pointing to [...Mathematica 12.app\/Contents\/MacOS\/WolframKernel", "-script", ... ]... could that be a problem? $\endgroup$ – M.R. Jul 8 at 20:46
  • $\begingroup$ @M.R. Yes, that’s what I guess you might have. So you can manually create another kernel file pointing to WLE to resolve this issue. $\endgroup$ – sunt05 Jul 8 at 20:51
  • $\begingroup$ Yea I just had to do this: jupyter kernelspec uninstall wolframlanguage-12.0.0, now working, thanks :) $\endgroup$ – M.R. Jul 8 at 21:12
  • $\begingroup$ Great to know this has been resolved :) $\endgroup$ – sunt05 Jul 8 at 21:26
  • $\begingroup$ Unfortunately none of the useful parts of mathematica frontend are available $\endgroup$ – M.R. Jul 8 at 22:30
2
$\begingroup$

Possibly the notebook here will help. Not sure, since I am not familiar with Nteract. https://community.wolfram.com/groups/-/m/t/1717637

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.