繁体   English   中英

Python系统找不到指定的文件

[英]PythonThe system cannot find the file specified

我正在尝试通过音频挑战解决 recaptha,但有一个问题。我可以下载音频并将 wav 文件转换为带有 Speech_recognition 的文本,但我无法将 mp3 文件转换为 wav 文件。 我总是收到这个错误。

File "C:\Pycharm\PycharmProjects\üst\deneme.py", line 9, in <module>
sound = AudioSegment.from_mp3(input_file)
File "C:\Python39\lib\site-packages\pydub\audio_segment.py", line 796, in from_mp3
return cls.from_file(file, 'mp3', parameters=parameters)
File "C:\Python39\lib\site-packages\pydub\audio_segment.py", line 728, in from_file
info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
File "C:\Python39\lib\site-packages\pydub\utils.py", line 274, in mediainfo_json
res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
File "C:\Python39\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Python39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

我试试这个:

print(os.path.exists('C:\Pycharm\PycharmProjects\sss.mp3')) # myauido file 
and result is True. I mean this file exists and I can run this file with 
os.system('sss.mp3')

问题是我如何解决这个问题这个文件存在并且找不到它。

sound = AudioSegment.from_mp3('sss.mp3')

如果我不能解决这个问题,还有其他方法吗?

“C:\Pycharm\PycharmProjects\üst\deneme.py” 我认为这个路径有问题或者是由“üst”中的“ü”引起的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM