简体   繁体   English

来自Windows XP上的emacs的ipython,没有提示,也没有打印输出

[英]ipython from emacs on windows XP, no prompt and no print output

I want to integrate ipython to emacs 23, on windows XP. 我想在Windows XP上将ipython集成到emacs 23中。 I could find quite some information online, but nothing did the trick. 我可以在网上找到相当多的信息,但没有做到这一点。

The following is required in my ~/.emacs.d/init.el : 我的~/.emacs.d/init.el需要以下~/.emacs.d/init.el

  • python-mode 蟒蛇模式
  • pymacs pymacs
  • ipython IPython中

pyreadline is also installed. pyreadline也已安装。

I launch ipython with a bat file (in my system path), with the flags -i and -u. 我使用bat文件(在我的系统路径中)使用标志-i和-u启动ipython。

The information text 信息文本

c:\Program\emacs-23.2\bin>c:\program\python27\scripts\ipython -i -u

Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.

IPython 0.10.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'. ?object also works, ?? prints more.

does not appear until I write the first command. 直到我写第一个命令才会出现。

I get no prompt. 我没有提示。 Writing and "executing" numbers do result in the red " Out[n]: " and the number. 写入和“执行”数字会导致红色“ Out[n]: ”和数字。 Print does not give anything. Print不提供任何东西。 a gives the a colorful ipython error text, ending with NameError: name 'a' not defined . a给出了一个色彩缤纷的ipython错误文本,以NameError: name 'a' not defined结尾NameError: name 'a' not defined

In other words, the error stream seems ok, the standard output seems ok, but print and whatever is responsible for printing the prompt cannot seem to find the correct stream. 换句话说,错误流似乎没问题,标准输出似乎没问题,但print和负责打印提示的任何东西似乎都找不到正确的流。


emacs *Message* buffer says: emacs *Message* buffer说:

comint-send-string: Output file descriptor of Python<1> is closed

for every output (not appearing) in the python shell. 对于python shell中的每个输出(不显示)。

Make sure you're using pyreadline 1.6 . 确保你使用的是pyreadline 1.6 Version 1.5 writes to the stream using the console API even when run via Emacs. 即使通过Emacs运行,1.5版也会使用控制台API写入流。 That causes many problems similar to the ones you are seeing. 这会导致许多类似于您所看到的问题。

我相信它是Python解释器本身,而不是接收-u参数的ipython脚本,即你的文件C:\\Program\\Python27\\scripts\\ipython.bat应该包含类似的东西:

@C:\Program\Python27\python.exe -u C:\Program\Python27\scripts\ipython.py %*

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

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