在Emacs 24.3中使用IPython模式

时间:2014-10-03 06:24:01

标签: python emacs

我正在Ubuntu 14.04上测试Emacs 24.3.1的ipython包。首先,我使用包管理器ipython安装了python-modeM-x list-packages。为了进行调试,我将我的初始文件~/.emacs简化为:

(setq debug-on-error t)
(require 'package)
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
                         ("marmalade" . "http://marmalade-repo.org/packages/")
                         ("melpa" . "http://melpa.milkbox.net/packages/")))

(package-initialize)
(require 'ipython)

第一个问题,为什么需要package-initializerequire 'ipython?我认为从包管理器安装后,这将自动开箱即用?

第二个问题,当我运行M-x py-shell时,我得到以下屏幕截图(t.py是测试Python脚本):

enter image description here

如图所示,我从IPython收到错误:

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

1 个答案:

答案 0 :(得分:1)

不需要ipython.el,这会导致此错误。

BTW作为python-mode.el的主干接近即将发布,可能值得一试。

https://launchpad.net/python-mode

bzr branch lp:python-mode