A spacemacs layer for Jupyter REPLs and their integration with org-mode,
including integration with org-babel and exporting of org files to
.ipynb. Currently a fork of benneti’s jupyter layer, though I have not
decided if I wish to keep this as a personal private layer.
Includes the following packages:
- dzop’s =emacs-jupyter=
- jkitchin’s =ox-ipynb=
companyvia thecompany-capfbackendpyvenv
To use this configuration layer, add it to your ~/.spacemacs. You will need
to add jupyter to the existing dotspacemacs-configuration-layers list in
this file.
Additionally you need to have jupyter available in your PATH.
The jupyter package also provides integration with org-babel via
ob-jupyter. To use the kernels in jupyter just add (jupyter . t) to your
org-babel-load-languages list as the last element. If no auto-completion is
used adding to the variable is sufficient as spacemacs provides a hook that
loads it the first time org-mode is started.
An example would be adding
(with-eval-after-load 'org
(setq org-babel-load-languages
(append org-babel-load-languages
'((latex . t)
;; jupyter has to be the last element
(jupyter . t))))
;; Execute load languages once, else autocompletion will only work in the
;; second org file one opens
(spacemacs//org-babel-do-load-languages))to your dotspacemacs/user-config.
Out of the box, the jupyter REPL should follow the path to the conda
environment set by pyvenv. In the event that this does not work, try adding
the following line to your dotspacemacs/user-init.
(add-hook 'pyvenv-post-activate-hooks (lambda() (jupyter-available-kernelspecs t)))
This guarantees that pyvenv will affect the path to the jupyter kernel.
As of this upload, I have removed all key bindings except for the following.
| Key Binding | Description |
|---|---|
SPC a j j | Start new REPL |
SPC a j r | Start new REPL |
SPC a j c | Connect to REPL |