gpt4 book ai didi

python - 用于 ipython 的 Emacs

转载 作者:太空宇宙 更新时间:2023-11-03 18:26:28 26 4
gpt4 key购买 nike

我在 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(不是 ipython)解释器显示错误:

ImportError: No module named IPython.core.completerlib

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

最佳答案

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

关于python - 用于 ipython 的 Emacs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23093554/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com