I'm trying using ipython in emacs. I installed python-mode and config ipython:

(require 'python-mode)
; use IPython
(setq-default py-shell-name "ipython")
(setq-default py-which-bufname "IPython")
(setq py-force-py-shell-name-p t)
(setq py-python-command-args '("-colors" "Linux"))
; switch to the interpreter after executing code
(setq py-shell-switch-buffers-on-execute-p t)
(setq py-switch-buffers-on-execute-p t)
; don't split windows
(setq py-split-windows-on-execute-p nil)
(add-hook 'python-mode-hook
  (lambda ()
    (local-set-key (kbd "C-c i") 'py-shell)))

I didn't call ipython with matplotlib, but when I tried C-c i in emacs, I got:

[TerminalIPythonApp] WARNING | Eventloop or matplotlib integration failed.
Is matplotlib installed?
ImportError                               Traceback (most recent call last)
ImportError: No module named matplotlib

It's the same error with running ipython --matplotlib. I didn't install matplotlib because I don't want to use it. So, I didn't set it in my config.

Why did emacs still call ipython with matplotlib?


IPython process reads py-ipython-command-args, which check.

BTW py-buffer-name is used as an internal variable, do not set it.

  • What did you mean? You can try ipython --matplotlib and got the same error if you don't install matplotlib. I have set the arguments for calling ipython, but emacs still called it with matplotlib.
    – cuonglm
    Jun 25 '15 at 7:09
  • @cuonglm Okay, got a glue, will correct my answer. Jun 25 '15 at 9:24
  • Thanks, it worked. Did it documented anywhere?
    – cuonglm
    Jun 25 '15 at 9:33
  • @cuonglm Great. For docu see README.org: * Selecting a Python shell Jun 25 '15 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.