BrokenPipeError when `poetry show -v | head -n 1`
See original GitHub issue-
I am on the latest Poetry version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption). -
OS version and name: Ubuntu 18.04 x64, zsh
-
Poetry version: 0.12.11
-
Link of a Gist with the contents of your pyproject.toml file: probably irrelevant
Issue
It was suggested on the issue tracker, that to “find the virtualenv path”, I run poetry show -v and look at the first line.
To automate that process, I tried executing poetry show -v | head -n 1 in zsh. However when head closes the pipe, Poetry instead raises BrokenPipeError.
https://gist.github.com/jimbo1qaz/014f6e831af944db235e77af61339b49 (poetry show -vvv, not -v)
Is this a reasonable use case? Is it possible to catch this error and stop writing to stdout (or terminate)?
(Note: on Windows, depending on buffer size, subprocess.Popen pipes may produce OSError instead. But this is not a Popen pipe, but a shell pipe.)
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)

Top Related StackOverflow Question
You don’t have to use poetry to handle virtualenvs. If a virtualenv is active, poetry will be happy to use it. So you can use pew or virtualenvwrapper or (I guess) conda to manage your virtualenvs and let poetry just handle the project’s dependencies.
Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one.