簡體   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