【问题标题】:Ipython Emacs integrationIpython Emacs 集成
【发布时间】:2011-11-22 12:04:14
【问题描述】:

最近有没有人设法让 Emacs 23、python-mode.el 和 ipython.el 一起工作?

我的 .emacs 看起来像这样:

(add-to-list 'load-path "~/.emacs.d/python-mode.el-6.0.3/")
(require 'python-mode)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(require 'ipython)

我在C-c ! 上遇到的错误是:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'olors' is not defined

【问题讨论】:

标签: python emacs ipython


【解决方案1】:

这是某人收到此错误的另一个原因:

如果给定 -color 参数,iPython 0.12 会以错误退出。

为我解决的问题是替换

(setq py-python-command-args '("-colors" "Linux"))

在我的 .emacs 中带有

(setq py-python-command-args '("--colors=linux"))

也就是说,确保传递给 iPython 的参数是有效的。如果不是,iPython 会出错退出,我们会退回到常规的 Python 解释器。

【讨论】:

    【解决方案2】:

    ipython.el 已经过时了。核心 IPython 开发人员都不知道 emacs lisp。现在有人working to fix it - 如果你有时间,请测试他的分支并报告它是否有效。

    【讨论】:

      【解决方案3】:

      我从 Emacs23 调用 IPython 时遇到了同样的错误。我通过在ipython.el 中将-colors 的所有实例替换为--colors 来修复它

      【讨论】:

        猜你喜欢
        • 2010-09-23
        • 2011-09-06
        • 2012-01-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多