7

Has anyone managed to get Emacs 23, python-mode.el and ipython.el working together recently?

my .emacs looks like this:

(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 C-c ! is:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'olors' is not defined
dierre
  • 7,140
  • 12
  • 75
  • 120
bph
  • 10,728
  • 15
  • 60
  • 135
  • You might want to look at this: http://stackoverflow.com/questions/304049/emacs-23-and-ipython and this: http://www.emacswiki.org/emacs/PythonProgrammingInEmacs#toc11 – Zsolt Botykai Nov 22 '11 at 13:49
  • 4
    Those links are a few years old now - I read them before posting. I think the problems I'm having relate to more recent releases (judging by some of the threads on github) – bph Nov 22 '11 at 14:20

3 Answers3

9

Here's another reason someone may be getting this error:

iPython 0.12 exits with an error if given a -color arg.

What fixed it for me was replacing

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

in my .emacs with

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

That is, make sure that the args passed to iPython were valid. If not, iPython exits with error and we fall back to the regular python interpreter.

Johnny Brown
  • 1,000
  • 11
  • 18
7

ipython.el is known to be out of date. None of the core IPython developers know emacs lisp. Someone is now working to fix it - if you have time, please test his branch and report whether it works.

Thomas K
  • 39,200
  • 7
  • 84
  • 86
2

I had the same error invoking IPython from Emacs23. I fixed it by replacing all instances of -colors with --colors in ipython.el

KartMan
  • 369
  • 3
  • 19