This simple program in Python 3
throws errors. What could be the reason? This problem arose after I installed/reinstalled Python 3.5/3.6
. Also Python 2.7
is installed on my PC (windows 10 machine).
import subprocess
out = subprocess.check_output(['dir'])
The error message:
File "C:\Python36\lib\subprocess.py", line 336, in check_output **kwargs).stdout
File "C:\Python36\lib\subprocess.py", line 403, in run with Popen(*popenargs, **kwargs) as process:
File "C:\Python36\lib\subprocess.py", line 707, in init restore_signals, start_new_session)
File "C:\Python36\lib\subprocess.py", line 990, in _execute_child startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified