[IPython-dev] Issues with shell commands in IPython Notebook (Windows version)
Matthias Bussonnier
bussonniermatthias at gmail.com
Wed Sep 24 05:47:13 EDT 2014
Hi,
!, is a shortcut for the magic %sx that in the end wrap subprocess, if you want to track down :
IPython.core.interactiveshell:system
IPython.utils.process:getoutput
IPython.utils._process_common:process_handle
p = subprocess.Popen(cmd, shell=isinstance(cmd, py3compat.string_types),
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=stderr,
close_fds=close_fds)
The limitation are the limitation of subprocess, and the limitation of user testing and developing on windows.
History can show you that not many windows de/user did care about this, and with no windows machine its hard to help.
https://github.com/ipython/ipython/commits/master/IPython/utils/_process_common.py
If you can try with Popen directly, and make it to work we can probably adapt the logic.
--
M
Le 24 sept. 2014 à 10:48, Kenneth Tran a écrit :
> I have 2 instances of IPython NBServer running, one runs on Linux and the other runs on Windows. Let's call them NB-Win and NB-Linux. On both machines, IPython was installed using Anaconda.
>
> The experience of calling shell commands on NB-Win has been terrible. Many commands hang for no reason.
>
> I've tried
> !wget http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/kddb.t.bz2
> (which is just 25MB) in a notebook on both servers.
>
> On NB-Win
> The command always failed to terminate. It hangs like this forever
>
> <image.png>
>
> When I looked at the wget process in Process Explorer, none of the numbers (CPU, memory, IO, network, etc.) moved. If I killed the process, then now the cell returned something, like this
>
> <image.png>
>
> The experience is the same with other commands. For example, I tried going to a directory and calling !make, and that one also didn't terminate.
>
> For comparison, this is what looks like when I run the same command using NB-Linux. The output is displayed as the program is running and the program exits in a few seconds.
> <image.png>
>
> So my questions are
> Why does the above command above (as well as many others) hang in NB-Win? (I could replicate this issue easily on my other Windows machines.)
> Why can't NB-Win display console output in real-time as the program is running? While both NB-Linux and IPython shell on Windows/Linux can.
> Why does NB-Win display a different output (or error?) string than what IPython-Win shell (on the same machine) produces? Both invoke the same C:\Cygwin\bin\wget.exe command line.
> <image.png>
>
> Those issues have driven me crazy. I would appreciate any help.
>
> -Ken
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140924/70463119/attachment.html>
More information about the IPython-dev
mailing list