[Python] subprocess.run won't recognise a command

Discussão em 'Python' iniciado por Stack, Agosto 13, 2025.

  1. Stack

    Stack Membro Participativo

    This is Linux terminal related and I'm very new to Linux, so please be patient with me.

    I'm using Python 3.12 on Linux (Bazzite, specifically) to run yt-dlp commands, with yt-dlp installed through Homebrew (yes, I know there's a Python package). The line that ultimately sends the command is subprocess.run(command), and the command it's sending works 100% fine if I run it directly in the terminal, but if it's run via this Python program it gives the error FileNotFoundError: [Errno 2] No such file or directory: 'yt-dlp [the rest of the command]'.

    I've tried adding executable='/bin/bash', and it doesn't error, but instead does absolutely nothing when run inside my IDE, and when running the program through the terminal it acts as if I've completely refreshed the terminal window (screenshot attached since it's hard to explain) and doesn't run the command.

    [​IMG]

    I have no idea what to try next, so any help figuring this out would be appreciated.

    Continue reading...

Compartilhe esta Página