-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bash cells show no intermediate output #2023
Comments
To me it seems that this is a bug in Ipython rather than in the notebook, since I was able to reproduce the same behavior in a simple ipython shell with the command
whereas
prints first the 1 and three seconds later the 2. |
I'm having the same problem. Would be nice to have this fixed. Otherwise I'm forced to run the bash scripts outside the notebook in order to have any idea of what's going on. |
@minrk is there anything we can do in terms of treating different lines of a bash cell (that aren't continued with |
It doesn't need to be executed as a separate cell, we just need to make sure we flush and republish the output we receive from the subprocess more frequently. I don't recall how exactly we are doing that right now. |
Would be great fix this for long running processes. Maybe something similar to what running bash scripts like !foo.sh does? The ! shortcut displays intermediate output. Thanks! |
The solution seems to be not using the default python kernel but using the
Restart your jupyter notebook, create a bash session, and you'll get immediate stdout/stderr display. |
this is rather a hack but it is possible to do it using subprocess module. following this question and assuming test.sh have the example given by @kscd it is possible to do it like this
|
I have made a cell magic called livebash to provide an alternative solution (plus extra features) for this problem: |
The %%bash cell does not show any output until everything is finished running.
For example
Will not output "Hello 1" until the whole cell is done, 5 seconds later.
My use case for this is that in my pipeline, I have some rather long process calls that ideally I would like to run via my notebook. However, not being able to inspect the output while it's running makes things difficult. Clearly for python cells this isn't a problem, can we solve it for bash cells?
The text was updated successfully, but these errors were encountered: