![]() # This function will call the python subprocess module's Popen method to invoke a system executable program. I use the python subprocess module’s Popen function to execute a windows executable program like below, and it throws the FileNotFoundError.2.1 The FileNotFoundError: Occurred When Use Python Subprocess Module’s Popen() Method. The subprocess module’s run method returns an instance of the subprocess.CompletedProcess class, this object records the completed process status data (ie: executed command, return code, etc.) 2. ![]() > ret = n(, shell=True)ĬompletedProcess(args=, returncode=0) After I add the shell=True argument in the subprocess module’s run method, it runs successfully like below.This error is because I run the above command in a window shell, but do not specify the shell=True argument in the subprocess module’s run method.With Popen(*popenargs, **kwargs) as process:įile "C:\Users\zhaosong\anaconda3\envs\env_python_37\lib\subprocess.py", line 800, in _init_įile "C:\Users\zhaosong\anaconda3\envs\env_python_37\lib\subprocess.py", line 1207, in _execute_childįileNotFoundError: The system cannot find the file specified > import subprocessįile "C:\Users\zhaosong\anaconda3\envs\env_python_37\lib\subprocess.py", line 488, in run Below is the detailed error message and the steps to reproduce it.The FileNotFoundError: The System Cannot Find The File Specified.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |