Skip to content
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

Provide a way to run conda run w/o buffering stdout (and output in general) #9412

Closed
Tracked by #11316
brettcannon opened this issue Nov 5, 2019 · 7 comments
Closed
Tracked by #11316
Labels
duplicate::primary if an issue/PR has duplicates, this is the consolidated, primary issue/PR locked [bot] locked due to inactivity plugins::run pertains to conda-run source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type

Comments

@brettcannon
Copy link
Contributor

brettcannon commented Nov 5, 2019

Currently conda run buffers everything going to stdout (I didn't test stderr). It would be great to be able to get streaming results from the running command rather than having to wait until the application exits.

@brettcannon brettcannon changed the title Provide a way to run conda run w/o buffering stdout Provide a way to run conda run w/o buffering stdout (and output in general) Nov 5, 2019
@msarahan
Copy link
Contributor

msarahan commented Nov 6, 2019

Yes, this would be a big improvement. I've looked at ways to "tee" this output, but it ended up being too deep of a rabbit hole at the time. If you have any recommendations for how to achieve this, please let us know.

@mingwandroid
Copy link
Contributor

conda-run also misses any way to handle stdin. IMHO a thread should be launched for all the IO.

@brettcannon
Copy link
Contributor Author

Does conda run do anything after the process exits? Could conda run use a os.exec*() function to substitute the conda process for the Python process in-place so that stdout and friends aren't buffered because Python now owns stdout and friends?

@earhart
Copy link

earhart commented Aug 1, 2020

FWIW -- as a workaround, I've noticed that using "conda run -n my_env bash -c 'my_actual_command > /dev/tty 2>&1'" seems to work on Linux (and should work fine on any Posix system).

@jcmuel
Copy link

jcmuel commented Oct 30, 2020

For those who need something similar to an unbuffered version of "conda run": The new --no-capture-output option (#9646) in conda 4.9.0 (see CHANGELOG) has a similar effect and solves the problem for me.

conda run --no-capture-output python3 -u -c $'import time;\nfor x in range(0, 9): print(0); time.sleep(.5)'

@kalindkaria
Copy link

Thank you for this update! It saved a lot of my time.

@kenodegard
Copy link
Contributor

Confirming this is addressed with the --no-capture-output argument.

@kenodegard kenodegard added the duplicate::primary if an issue/PR has duplicates, this is the consolidated, primary issue/PR label Mar 10, 2022
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Mar 11, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate::primary if an issue/PR has duplicates, this is the consolidated, primary issue/PR locked [bot] locked due to inactivity plugins::run pertains to conda-run source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants