Jupyter Notebook安装库失败,报[WinError 2]文件未找到错误
无法在Jupyter Notebook中安装ffprobe相关库
在Jupyter Notebook中执行pip install ffprobe时,出现如下错误:
--------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_19512\1427077936.py in <module> ----> 1 get_ipython().run_line_magic('conda', 'install -c travis ffprobe') ~\anaconda3\lib\site-packages\IPython\core\interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth) 2362 kwargs['local_ns'] = self.get_local_scope(stack_depth) 2363 with self.builtin_trap: -> 2364 result = fn(*args, **kwargs) 2365 return result 2366 ~\anaconda3\lib\site-packages\decorator.py in fun(*args, **kw) 230 if not kwsyntax: 231 args, kw = fix(args, kw, sig) -> 232 return caller(func, *(extras + args), **kw) 233 fun.__name__ = func.__name__ 234 fun.__doc__ = func.__doc__ ~\anaconda3\lib\site-packages\IPython\core\magic.py in <lambda>(f, *a, **k) 185 # but it's overkill for just that one bit of state. 186 def magic_deco(arg): -> 187 call = lambda f, *a, **k: f(*a, **k) 188 189 if callable(arg): ~\anaconda3\lib\site-packages\IPython\core\magics\packaging.py in conda(self, line) 107 extra_args.extend(["--prefix", sys.prefix]) 108 -> 109 self.shell.system(' '.join([conda, command] + extra_args + args)) 110 print("\nNote: you may need to restart the kernel to use updated packages.") ~\anaconda3\lib\site-packages\ipykernel\zmqshell.py in system_piped(self, cmd) 629 if path is not None: 630 cmd = "pushd %s &&%s" % (path, cmd) -> 631 self.user_ns["_exit_code"] = system(cmd) 632 else: 633 self.user_ns["_exit_code"] = system(self.var_expand(cmd, depth=1)) ~\anaconda3\lib\site-packages\IPython\utils\_process_win32.py in system(cmd) 143 if path is not None: 144 cmd = '"pushd %s &&"%s' % (path, cmd) -> 145 return process_handler(cmd, _system_body) 146 147 def getoutput(cmd): ~\anaconda3\lib\site-packages\IPython\utils\_process_common.py in process_handler(cmd, callback, stderr) 77 if shell and os.name == 'posix' and 'SHELL' in os.environ: 78 executable = os.environ['SHELL'] -> 79 p = subprocess.Popen(cmd, shell=shell, 80 executable=executable, 81 stdin=subprocess.PIPE, ~\anaconda3\lib\site-packages\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, user, group, extra_groups, encoding, errors, text, umask) 949 encoding=encoding, errors=errors) 950 -> 951 self._execute_child(args, executable, preexec_fn, close_fds, 952 pass_fds, cwd, env, 953 startupinfo, creationflags, shell, ~\anaconda3\lib\site-packages\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session) 1418 # Start the process 1419 try: -> 1420 hp, ht, pid, tid = _winapi.CreateProcess(executable, args, 1421 # no special security 1422 None, None, FileNotFoundError: [WinError 2] The system cannot find the file specified
我尝试过以下方法,但都没能解决问题:
- 执行
pip install ffprobe-python --user,仍出现相同错误 - 执行
pip install --upgrade pip升级pip,无效 - 检查anaconda3/share/jupyter/python3路径下的kernel.json文件,未发现异常
- 修改subprocess.py的__init__函数,将shell参数设为True,问题依旧
- 尝试
%conda install -c travis ffprobe,仍出现相同错误
我是新手,若需要更多信息请告知,非常感谢您的帮助。
内容的提问来源于stack exchange,提问作者worstusername
相关产品推荐
相关产品推荐

