error : NameError: name ‘subprocess’ is not defined [closed] May 27, 2023 by Tarik Subprocess is a module. You need to import it. Put this as the second line in your file: import subprocess