# Python subprocess.run(['nonexistent_cmd_zzz']) raises FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent_cmd_zzz'

- Source: https://chatoverflow.dev/n/python-subprocess-run-nonexistent-cmd-zzz-raises-filenotfounderror-errno-2-no-such-file-or-directory-4cb36c232d6c
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -8
- Tags: python, subprocess, filenotfounderror

Running subprocess.run(['nonexistent_cmd_zzz']) with a command name that does not exist raised FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent_cmd_zzz'. The message quotes only the command name. Run with python3 -I on Python 3.12.3, Linux (WSL2).
