I had a few difficulties installing it, so maybe this write-up will be all the more useful.
Here is how things go if everything works well:
-
Installation:
-
Usage:
-
Run a Julia REPL:
M-x
jupyter-run-replRET -
Associate jour julia buffer(s) to the kernel:
M-x
jupyter-repl-associate-bufferRET -
You’re good to go, and benefit from a few features, among which:
- C-M-x: evaluate the defun at point
- C-cC-c: evaluate the line/region at point
- C-cC-b: evaluate the whole buffer
- M-i: get help for the thing at point
-
Here is what a small example session looks like:
- I evaluated the function first using C-M-x
- then the
hello()call in the file using C-cC-c; this opened the “output” window at the bottom right - I manually typed
hello()in the REPL (top right wndow) - I pressed M-i with point on
println; this opened the bottom left help window.
Now, here are the issues I had:
-
“Modules are not supported” at step 2: this is because your Emacs should support dynamic modules. It wasn’t the case for my out-of-the-box Emacs version on Debian and I had to manually rebuild and reinstall an Emacs version configured using
--with-modules. -
“No kernelspecs available” at step 2: if, like me, you let
IJuliainstall jupyter automagically for you, chances are that thejupytercommand is not in yourPATH. You’ll have to add the correct jupyter installation directory to yourPATHfor Emacs to be able to find it.-
first, determine the correct directory by running a notebook:
julia> using IJulia julia> notebook() [ Info: running setenv(`/home/francois/.julia/conda/3/bin/jupyter notebook`,["PATH= /home/francois/.julia/conda/3/bin:/home/francois/.scripts:/home/francois/.local/bin :/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/francois/.local/jul ia-1.1.0/bin/:/home/francois/projets/git/skeleton.jl/:/home/francois/.local/julia-1 .1.0/bin/:/home/francois/projets/git/skeleton.jl/", ... ...])In this case, the directory we’re looking for is:
/home/francois/.julia/conda/3/bin -
then, add this directory to your
PATH, either from your.bashrcfile (or equivalent for your shell), or directly from Emacs:(setenv "PATH" (concat "/home/francois/.julia/conda/3/bin:" (getenv "PATH")))
-
