【问题标题】:ipython in emacs no figure outputemacs中的ipython没有数字输出
【发布时间】:2013-05-01 18:56:03
【问题描述】:

我在 windows 下使用 emacs 24.3,ipython 0.13.1,python 2.7.3 我使用带有 emacs 的 python.el 配置 ipython shell

;; setup ipython for default interpreter
(setq python-shell-interpreter "C:/Python27/python")
(setq python-shell-interpreter-args "-i C:/Python27/Scripts/ipython-script.py --pylab")
(setq python-shell-prompt-regexp "In \\[[0-9]+\\]: ")
(setq python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: ")
(setq python-shell-completion-setup-code "from IPython.core.completerlib import module_completion")
(setq python-shell-completion-module-string-code "';'.join(module_completion('''%s'''))\n")
(setq python-shell-completion-string-code "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")

效果很好,只是没有数字输出... 有人在这里有同样的经历吗?解决办法?

【问题讨论】:

    标签: emacs ipython


    【解决方案1】:

    看起来您正在使用 Qt4Agg 后端(请参阅欢迎留言)。这意味着您应该看到一个显示绘图的窗口。如果没有,我建议你编写一个脚本并在 Emacs 和 IPython 之外执行它来定位问题。

    如果你想在 Emacs 中查看绘图,可以使用我的插件 EIN

    【讨论】:

    • 我确实看到了一个图形窗口弹出,但随后它在没有任何实际情节的情况下冻结。
    【解决方案2】:

    真正的解决办法是修改

    (setq python-shell-interpreter-args "-i C:/Python27/Scripts/ipython-script.py --pylab")
    

    (setq python-shell-interpreter-args "-i C:/Python27/Scripts/ipython-script.py console --pylab")
    

    【讨论】:

      【解决方案3】:

      试试 pyplot.show(block=True)

      【讨论】:

        【解决方案4】:

        你必须添加

        (setq python-shell-interpreter-args "-i C:/Python27/Scripts/ipython-script.py --pylab=inline")
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2020-11-19
          • 1970-01-01
          • 2021-08-05
          • 1970-01-01
          • 1970-01-01
          • 2010-09-23
          相关资源
          最近更新 更多