3

I can't work out how to get the %edit command working in Jupyter Notebook.

I type

%edit

and it returns with

IPython will make a temporary file named: /var/folders/dk/.../ipython_edit_JbS9ZC.py

My %EDITOR environment variable is

'EDITOR': '/usr/local/bin/subl -w'

I must be doing something wrong.

pheon
  • 2,867
  • 3
  • 26
  • 33
  • 1
    I have exactly the same problem ! It works perfectly in the IPython shell though – Labo Jun 03 '16 at 22:15
  • Have you tried to "control the editor by setting TerminalInteractiveShell.editor in ipython_config.py" (https://ipython.org/ipython-doc/1/config/editors.html) after creating a profile (https://ipython.org/ipython-doc/3/config/intro.html) ? – Labo Jun 03 '16 at 22:36
  • It also works in the iPython shell for me. I am a little confused about how to configure Jupyter (http://jupyter.readthedocs.io/en/latest/migrating.html) but I think the setting should go elsewhere. However, if I set it using '%config InteractiveShell.editor = 'nano'' and use '%env', I get ''EDITOR': 'nano'', and it still doesn't work. Is %edit supposed to work in the jupyter notebook? – pheon Jun 04 '16 at 13:25
  • I really don't know, I have exactly the same problem ! – Labo Jun 04 '16 at 18:36

1 Answers1

1

This feature issue appears to be well-known : https://github.com/ipython/ipython/issues/5879

A possible solution might be to use : Edit IPython cell in an external editor

Or you can embed the notebook in emacs (I don't use emacs) : https://github.com/tkf/emacs-ipython-notebook

Community
  • 1
  • 1
Labo
  • 2,482
  • 2
  • 18
  • 38