Emacs ipython on Windows XP, no prompt and no print

I want to integrate ipython in emacs 23, on Windows XP. I could find quite some information on the Internet, but nothing did the trick.

In my ~/.emacs.d/init.el :

The following is required:
  • Python mode
  • pymacs
  • Ipython

Pyreadline is also installed.

I run ipython with the bat file (in my system path), with the -i and -u flags.

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 features. %quickref -> Quick reference. help -> Python own help system. object? -> Details about 'object'. ?object also works, ?? prints more. 

does not appear until I write the first command.

I do not get any clues. Writing and β€œexecuting” numbers results in a red β€œ Out[n]: ” and a number. Print gives nothing. a gives ipython color error text ending with NameError: name 'a' not defined .

In other words, the error stream looks fine, the standard output looks fine, but Print and everything responsible for printing the request do not seem to be able to find the correct stream.


emacs *Message* buffer says:

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

for each output (not showing) in the python shell.

+4
source share
2 answers

Make sure you are using pyreadline 1.6 . Version 1.5 is written to the stream using the console API even when launched through Emacs. This causes a lot of problems, like the ones you see.

0
source

I believe this is the Python interpreter itself, not the ipython script, which should accept the -u option, i.e. your file C:\Program\Python27\scripts\ipython.bat should contain something like:

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

Source: https://habr.com/ru/post/1332467/


All Articles