简体   繁体   中英

ipython under Emacs for WIndows hangs shell

Hi I recently downloaded ipython 0.12.1 – April 2012 and got it to work under Windows' terminal. ie I open a command prompt and type ipython and then the ipython prompt appears.

All good and dandy until I needed to use it in emacs. So before even trying to use the pyton-mode.el or ipython.el (which at the moment freeze my emacs ), I tried to do a Mx shell or Mx eshell and type ipython -i.

This is the trace I get before a complete hang of the shell:

ipython -i

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.

IPython 0.12.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
WARNING: Readline services not available or not loaded.WARNING: Proper color support under MS Windows requires the pyreadline library.
You can find it at:
http://ipython.org/pyreadline.html
Gary's readline needs the ctypes module, from:
http://starship.python.net/crew/theller/ctypes
(Note that ctypes is already part of Python versions 2.5 and newer).

Defaulting color scheme to 'NoColor'

So why does it hang in the emacs shell and work in a regular command prompt. Do I need to change my default emacs shell? I also tried this on two different machines. Am I missing something?

Well apparently the only way to do this under Windows is to create a batch file, even though in the 0.12 distribution there exists an executable (ipython.exe). My script reads as follows:

[ipython.bat] @python.exe -i C:\\devel\\Python\\2.7-bin\\Scripts\\ipython-script.py --pylab %*

For the users of matplotlib and numpy under Windows, the pylab option still doesn't work correctly as it will freeze your figure windows. To get that working, I had to revert to ipython 0.10 and use the -wthread option rather than -pylab in the ipython.bat script. This actually produces a nice interactive-figure environment

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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