Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError: [WinError 2] #758

Open
fzxsb opened this issue Oct 23, 2023 · 0 comments
Open

FileNotFoundError: [WinError 2] #758

fzxsb opened this issue Oct 23, 2023 · 0 comments

Comments

@fzxsb
Copy link

fzxsb commented Oct 23, 2023

FileNotFoundError Traceback (most recent call last)
Cell In[6], line 54
51 print("读取mp3文件:", x)
53 # 提取视频文件音频
---> 54 audio = AudioSegment.from_file(video_file)
56 # 保存wav文件的路径和名称
57 audio.export('D:/Users/12637/Desktop/mp3_folder/'+filename+".wav", format="wav")

File G:\anaconda\Lib\site-packages\pydub\audio_segment.py:728, in AudioSegment.from_file(cls, file, format, codec, parameters, start_second, duration, **kwargs)
726 info = None
727 else:
--> 728 info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
729 if info:
730 audio_streams = [x for x in info['streams']
731 if x['codec_type'] == 'audio']

File G:\anaconda\Lib\site-packages\pydub\utils.py:274, in mediainfo_json(filepath, read_ahead_limit)
271 file.close()
273 command = [prober, '-of', 'json'] + command_args
--> 274 res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
275 output, stderr = res.communicate(input=stdin_data)
276 output = output.decode("utf-8", 'ignore')

File G:\anaconda\Lib\subprocess.py:1026, in Popen.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, pipesize, process_group)
1022 if self.text_mode:
1023 self.stderr = io.TextIOWrapper(self.stderr,
1024 encoding=encoding, errors=errors)
-> 1026 self._execute_child(args, executable, preexec_fn, close_fds,
1027 pass_fds, cwd, env,
1028 startupinfo, creationflags, shell,
1029 p2cread, p2cwrite,
1030 c2pread, c2pwrite,
1031 errread, errwrite,
1032 restore_signals,
1033 gid, gids, uid, umask,
1034 start_new_session, process_group)
1035 except:
1036 # Cleanup if the child failed starting.
1037 for f in filter(None, (self.stdin, self.stdout, self.stderr)):

File G:\anaconda\Lib\subprocess.py:1538, in Popen._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, unused_process_group)
1536 # Start the process
1537 try:
-> 1538 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
1539 # no special security
1540 None, None,
1541 int(not close_fds),
1542 creationflags,
1543 env,
1544 cwd,
1545 startupinfo)
1546 finally:
1547 # Child is launched. Close the parent's copy of those pipe
1548 # handles that only the child should have open. You need
(...)
1551 # pipe will not close when the child process exits and the
1552 # ReadFile will hang.
1553 self._close_pipe_fds(p2cread, p2cwrite,
1554 c2pread, c2pwrite,
1555 errread, errwrite)

FileNotFoundError: [WinError 2] 系统找不到指定的文件。

Your System configuration

  • Python version: Python 3.11.5
  • Pydub version: pydub 0.25.1
  • ffmpeg or avlib?: ffmpeg
  • ffmpeg/avlib version: ffmpeg 1.4

Does anyone know how to solve this problem?
It seem that functions in the pydub library cannot be found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant