简体   繁体   English

Emacs下用于Windows的ipython挂壳

[英]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. 嗨,我最近下载了ipython 0.12.1 – 2012年4月,并使其可以在Windows终端下运行。 ie I open a command prompt and type ipython and then the ipython prompt appears. 即我打开命令提示符并键入ipython,然后出现ipython提示符。

All good and dandy until I needed to use it in emacs. 一切顺利,直到我需要在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. 因此,甚至在尝试使用pyton-mode.el或ipython.el(此刻冻结了我的emacs)之前,我都尝试过制作Mx shell或Mx eshell并键入ipython -i。

This is the trace I get before a complete hang of the shell: 这是在完全挂起外壳之前得到的跟踪:

ipython -i 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. 那么,为什么它挂在emacs shell中并在常规命令提示符下工作。 Do I need to change my default emacs shell? 我需要更改默认的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). 显然,在Windows下执行此操作的唯一方法是创建一个批处理文件,即使在0.12发行版中存在一个可执行文件(ipython.exe)。 My script reads as follows: 我的脚本内容如下:

[ipython.bat] @python.exe -i C:\\devel\\Python\\2.7-bin\\Scripts\\ipython-script.py --pylab %* [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. 对于Windows下的matplotlib和numpy的用户,pylab选项仍然无法正常工作,因为它将冻结您的图形窗口。 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. 为了使它正常工作,我必须还原到ipython 0.10并在ipython.bat脚本中使用-wthread选项而不是-pylab。 This actually produces a nice interactive-figure environment 这实际上产生了一个很好的交互式图形环境

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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