【问题标题】:Emacs for ipython用于 ipython 的 Emacs
【发布时间】:2014-04-15 20:12:02
【问题描述】:

我在 mac 上使用 Emacs 版本 24.3。而python是'2.7.6',ipython是'1.2.1'。

但是当我想在带有代码的 emacs 中使用 ipython 时:

(require 'python)
(setq
  python-shell-interpreter "ipython"
  python-shell-interpreter-args ""
  python-shell-prompt-regexp "In \\[[0-9]+\\]: "
  python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: "
  python-shell-completion-setup-code
    "from IPython.core.completerlib import module_completion"
  python-shell-completion-module-string-code
    "';'.join(module_completion('''%s'''))\n"
  python-shell-completion-string-code
    "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")

但是当我按“C-c C-z”时,它显示:

Run Python: nil

当我按 ENTER 时,返回错误:

Searching for program: no such file or directory, nil

我也试过了:

Run Python: python

python (not ipython) 解释器出现错误:

ImportError: No module named IPython.core.completerlib

如何才能在 emacs 中正确使用 Ipython 解释器???谢谢。

【问题讨论】:

    标签: python emacs ipython


    【解决方案1】:

    python-mode 中有一个菜单PyShell -> ipython-dedicated。我认为这是最简单的。

    【讨论】:

    • 而且我使用的是 emacs24.3,正如我从网上了解到的那样,在大多数人使用 python.el 而不是 python-mode.el 的版本中,它使 emacs 中的 ipython 更容易,但是我不知道为什么我的不起作用。
    • @acui145: 好吧,只需从我发布的链接下载 tar,然后阅读INSTALL 那里。 python.el 也可能有一个简单的解决方案。如果没有其他考虑可以试试python-mode.el
    • 干杯!!!我解决了!!!如果我​​只是将“python-shell-interpreter”更改为“PATH/TO/IPYTHON”,它可以工作。这让我困惑了2个月!!!谢谢!!!但是我还是不明白为什么我的必须指出ipython的目录?
    • Nice :) 我使用 ipython 的诀窍是让 jedi 拥有一个不错的完成系统:wikemacs.org/index.php/Python#Jedi
    猜你喜欢
    • 1970-01-01
    • 2010-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多