emacs-jupyter / jupyter

An interface to communicate with Jupyter kernels.
GNU General Public License v3.0
930 stars 92 forks source link

Block source with jupyter-python as a language does not highlight the code #466

Open arael opened 1 year ago

arael commented 1 year ago

I have an installation of emacs-jupyter and I can export simple code as jupyter notebooks.

The problems is that on my system jupyter-python is nowhere to be found, and therefore the syntax highlighting does not work.

Of course, the code execution does not work either.

If I try to execute a simple bit of code such as:

#+BEGIN_SRC jupyter-python :session py 
x = 'foo'
y = 'bar'
x + ' ' + y
#+END_SRC

I get this error:

error in process sentinel: Symbol’s function definition is void: org-babel-execute:jupyter-python

How do I install jupyter-python and fix this issue?

nnicandro commented 11 months ago

If you've installed emacs-jupyter correctly, you should have something like

(org-babel-do-load-languages
 'org-babel-load-languages
 `((emacs-lisp . t)
   (python . t)
   (jupyter . t)))

in your ~/.emacs.d/init.el file and it should have been evaluated before opening your Org file. Then the Babel execute function should be defined.