首页 > 解决方案 > ImportError("找不到 FluidSynth 库。")

问题描述

我已经安装了流体合成器 2.0.5 版并在 mingus 中使用它。但是,当我运行代码时

from mingus.midi import fluidsynth

它返回这个

Traceback (most recent call last):
  File "/Users/rudiherrig 1 2/Desktop/pythonstuff/musicExp.py", line 1, in <module>
    from mingus.midi import fluidsynth
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mingus/midi/fluidsynth.py", line 37, in <module>
    from mingus.midi import pyfluidsynth as fs
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mingus/midi/pyfluidsynth.py", line 41, in <module>
    raise ImportError("Couldn't find the FluidSynth library.")
ImportError: Couldn't find the FluidSynth library.

我发现这很混乱,因为我安装了流体合成器。有想法该怎么解决这个吗?编辑:我在我的库中找到了一个名为 fluidsynth_dll.dsp 的文件,所以我不知道它为什么会返回这个错误。

标签: pythonfluidsynth

解决方案


你需要安装libfluidsynth.dll

  1. 从以下网址下载预编译的 DLL:https ://zdoom.org/downloads#Support
  2. 如果您使用 64x 版本将文件重命名libfluidsynth64.dlllibfluidsynth.dll
  3. 将其放入C:\Windows\System32

您也可以使用 GitHub 项目自行编译


推荐阅读