简体   繁体   English

Ipython Emacs集成

[英]Ipython Emacs integration

Has anyone managed to get Emacs 23, python-mode.el and ipython.el working together recently? 最近有没有人设法让Emacs 23,python-mode.el和ipython.el合作?

my .emacs looks like this: 我的.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)

the error I'm getting on Cc ! 我在Cc !遇到的错误Cc ! is: 是:

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

Here's another reason someone may be getting this error: 以下是有人可能收到此错误的另一个原因:

iPython 0.12 exits with an error if given a -color arg. 如果给出-color arg,iPython 0.12将退出并出现错误。

What fixed it for me was replacing 为我修好的是取代

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

in my .emacs with 在我的.emacs中

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

That is, make sure that the args passed to iPython were valid. 也就是说,确保传递给iPython的args是有效的。 If not, iPython exits with error and we fall back to the regular python interpreter. 如果没有,iPython退出时会出错,我们会回到常规的python解释器。

ipython.el is known to be out of date. 众所周知,ipython.el已经过时了。 None of the core IPython developers know emacs lisp. 没有核心的IPython开发人员知道emacs lisp。 Someone is now working to fix it - if you have time, please test his branch and report whether it works. 有人正在努力修复它 - 如果你有时间,请测试他的分支并报告它是否有效。

I had the same error invoking IPython from Emacs23. 我从Emacs23调用IPython时遇到了同样的错误。 I fixed it by replacing all instances of -colors with --colors in ipython.el 我通过替换的所有实例固定它-colors--colorsipython.el

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM