[Python] Why does "pip list" not like pipes on the bash command line?

Discussão em 'Python' iniciado por Stack, Maio 22, 2025.

  1. Stack

    Stack Membro Participativo

    I'm using a bash terminal.

    I just wanted to peek at the first few names of installed python packages:

    pip list | head -n5


    And got an error message:

    Package Version
    ------------------ ----------------
    attrs 21.2.0
    Automat 20.2.0
    Babel 2.8.0
    ERROR: Pipe to stdout was broken
    Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
    BrokenPipeError: [Errno 32] Broken pipe


    Is something broken? If I'm going to capture that information programmatically, I definitely don't want an error message included.

    Continue reading...

Compartilhe esta Página