I use a Jupyter Notebook to find out Analysis of the main components from kaggle ), but when I run this code
from subprocess import check_output print(check_output(["ls", "../input"]).decode("utf8"))
I got an error below
FileNotFoundError Traceback (most recent call last) <ipython-input-3-de0e39ca3ab8> in <module>() 1 from subprocess import check_output ----> 2 print(check_output(["ls", "C:/Users/wanglei/Documents/input"]).decode("utf8")) D:\Anaconda3\lib\subprocess.py in check_output(timeout, *popenargs, **kwargs) 624 625 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, --> 626 **kwargs).stdout 627 628 D:\Anaconda3\lib\subprocess.py in run(input, timeout, check, *popenargs, **kwargs) 691 kwargs['stdin'] = PIPE 692 --> 693 with Popen(*popenargs, **kwargs) as process: 694 try: 695 stdout, stderr = process.communicate(input, timeout=timeout) D:\Anaconda3\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds) 945 c2pread, c2pwrite, 946 errread, errwrite, --> 947 restore_signals, start_new_session) 948 except: 949
The path is correct, and it seems that all calls from the subprocess will fail in the same way.
Does anyone know why this is happening?