Pylab not loading in emacs using ipython

I am using Emacs 24.3 on Windows 8. Using PowerShell, it ipython

loads pylab

without issue:

PS C:\Users\vince.forgetta> ipython --pylab
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 2.2.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython features.
%quickref -> Quick reference.
help      -> Python own help system.
object?   -> Details about 'object', use 'object??' for extra details.
Using matplotlib backend: TkAgg

In [1]: linspace
Out[1]: <function numpy.core.function_base.linspace>

In [2]: plot
Out[2]: <function matplotlib.pyplot.plot>

      

However, using Emacs 24.3, I get the following error:

Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 2.2.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython features.
%quickref -> Quick reference.
help      -> Python own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: 
In [2]: 
In [3]: 
In [4]: linspace
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-4-fbab96054277> in <module>()
----> 1 linspace

NameError: name 'linspace' is not defined

In [5]: plot
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-5-88d627f14d84> in <module>()
----> 1 plot

NameError: name 'plot' is not defined

      

Which can be solved by importing pylab:

In [6]: from pylab import *

In [7]: linspace
Out[7]: <function numpy.core.function_base.linspace>

      

Specific Python code in mine .emacs

:

;; Python
(setenv "PYTHONUNBUFFERED" "x")
; python-mode
(setq py-install-directory "~/.emacs.d/python-mode.el-6.1.3")
(add-to-list 'load-path py-install-directory)
(require 'python-mode)
; use IPython
(setq-default py-shell-name "ipython")
(setq-default py-which-bufname "IPython")
;; use the wx backend, for both mayavi and matplotlib
(setq py-python-command-args
  '("--gui=wx" "--pylab=wx" "--colors=Linux"))
(setq py-force-py-shell-name-p t)
; 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)
; try to automagically figure out indentation
(setq py-smart-indentation t)

      

It follows what is pylab

imported when ipython

the parameter starts to be used --pylab

, but obviously it doesn't work as I expect, or there is an error somewhere. Buffer messages do not report any errors.

How do I get pylab

to download automatically when the buffer starts ipython

?

Thank.

+3


source to share





All Articles