【问题标题】:%edit magic command not working in jupyter notebook%edit 魔术命令在 jupyter notebook 中不起作用
【发布时间】:2016-06-03 18:56:20
【问题描述】:

我不知道如何让 %edit 命令在 Jupyter Notebook 中工作。

我输入

%edit

它返回

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

我的 %EDITOR 环境变量是

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

我一定是做错了什么。

【问题讨论】:

  • 我也有同样的问题!它在 IPython shell 中完美运行
  • 您是否在创建配置文件 (ipython.org/ipython-doc/3/config/intro.html) 后尝试“通过在 ipython_config.py 中设置 TerminalInteractiveShell.editor 来控制编辑器”(ipython.org/ipython-doc/1/config/editors.html)?
  • 它也适用于我的 iPython shell。我对如何配置 Jupyter (jupyter.readthedocs.io/en/latest/migrating.html) 有点困惑,但我认为该设置应该放在其他地方。但是,如果我使用 '%config InteractiveShell.editor = 'nano'' 设置它并使用 '%env',我会得到 ''EDITOR': 'nano'',但它仍然不起作用。 %edit 应该在 jupyter notebook 中工作吗?
  • 我真的不知道,我也有同样的问题!

标签: jupyter-notebook


【解决方案1】:

这个功能问题似乎是众所周知的:https://github.com/ipython/ipython/issues/5879

可能的解决方案是使用:Edit IPython cell in an external editor

或者你可以将 notebook 嵌入到 emacs 中(我不使用 emacs):https://github.com/tkf/emacs-ipython-notebook

【讨论】:

  • 加 1 表示 功能问题 而不是 bug
猜你喜欢
  • 2017-05-23
  • 1970-01-01
  • 2018-10-30
  • 2016-05-03
  • 1970-01-01
  • 2019-11-24
  • 2020-01-17
  • 1970-01-01
相关资源
最近更新 更多