gpt4 book ai didi

python - 修复 subprocess.py 文件错误 : File not found?

转载 作者:太空宇宙 更新时间:2023-11-03 21:03:08 29 4
gpt4 key购买 nike

我正在使用 Gray Arrow's Dejavu 中的 python 包。我已经安装了运行代码所需的所有依赖项和其他包。运行以下代码时:

    import warnings
import json
warnings.filterwarnings("ignore")

from dejavu import Dejavu
from dejavu.recognize import FileRecognizer

with open('dejavu.cnf') as f:
config = json.load(f)

djv = Dejavu(config)

djv.fingerprint_file('mp3/Sean-Fournier--Falling-For-You.mp3')

song = djv.recognize(FileRecognizer, 'mp3/Sean-Fournier--Falling-For-
You.mp3')

print("from file recognized: {}\n".format(song))

我收到以下错误:

    Traceback (most recent call last):
File "testing.py", line 13, in <module>
djv.fingerprint_file('mp3/Sean-Fournier--Falling-For-You.mp3')

File "D:\dejavu-master\dejavu\__init__.py", line 109, in
fingerprint_file song_name=song_name

File "D:\dejavu-master\dejavu\__init__.py", line 182, in
_fingerprint_worker channels, Fs, file_hash = decoder.read(filename,
limit)

File "D:\dejavu-master\dejavu\decoder.py", line 51, in read
audiofile = AudioSegment.from_file(filename)

File "C:\Program Files\Python37\lib\site-
packages\pydub\audio_segment.py", line 665, in from_file info =
mediainfo_json(orig_file)

File "C:\Program Files\Python37\lib\site-packages\pydub\utils.py",
line 263, in mediainfo_json res = Popen(command,
stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)

File "C:\Program Files\Python37\lib\subprocess.py", line 775, in
__init__ restore_signals, start_new_session)

File "C:\Program Files\Python37\lib\subprocess.py", line 1178, in
_execute_child startupinfo)

FileNotFoundError: [WinError 2] The system cannot find the file
specified

我已经完全重新安装了 python 3.7 以及所有软件包和依赖项,以尝试解决此问题。

我不明白找不到什么文件,并进行了研究,希望找到这个问题的答案。我衷心感谢您就该主题与我分享的任何帮助和知识。

最佳答案

尝试将“Sean-Fournier--Falling-For-You.mp3”文件放置在您的脚本所在的确切目录中,我认为对 mp3 文件夹的文件夹引用未正确处理:)

djv.fingerprint_file('mp3/Sean-Fournier--Falling-For-You.mp3')

song = djv.recognize(FileRecognizer, 'mp3/Sean-Fournier--Falling-For-
You.mp3')

关于python - 修复 subprocess.py 文件错误 : File not found?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55599847/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com