4

I have both fluidsynth

sudo apt-get install fluidsynth

and pyfluidsynth

sudo pip install pyfluidsynth

installed.

However, when I run the standard import commands, I get the following error:

>>> import fluidsynth
>>> fs = fluidsynth.Synth()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Synth'
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
  • What happens if you do `print fluidsynth.__version__`? – Michael0x2a Nov 16 '13 at 18:52
  • >>> fluidsynth.__version__ Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute '__version__' >>> dir(fluidsynth) ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__'] – Mittenchops Nov 16 '13 at 18:54

2 Answers2

3

For whatever reason, it appears as if following your installation directions made you download fluidsynth version 0.2, instead of version 1.2.4, which is the most recent one.

To install the correct package, uninstall fluidsynth and manually install the correct package (the tar.gz file from the pypi page for fluidsynth):

pip uninstall pyfluidsynth
pip install -Iv https://pypi.python.org/packages/source/p/pyFluidSynth/pyFluidSynth-1.2.4.tar.gz#md5=60079310701d0b9298b65a8b6728ffcc
Michael0x2a
  • 58,192
  • 30
  • 175
  • 224
  • 1
    Thanks! That helped! dir(fluidsynth) now returns functions! I'm still getting errors, but they appear to be with JACK not fluidsynth installation anymore: ```>>> fs.start() Cannot use real-time scheduling (RR/5)(1: Operation not permitted) JackClient::AcquireSelfRealTime error``` – Mittenchops Nov 16 '13 at 19:55
  • 2
    It's because he probably did `pip install fluidsynth`, which is another package. `pip install pyfluidsynth` should be working fine. – Rad'Val Sep 30 '17 at 13:54
  • As Valentin Radu noted, there is a dead package named fluidsynth (2012). If you had installed the old fluidsynth, the fix is to `pip uninstall fluidsynth`. Even though I had done `pip install pyfluidsynth`, because pyfluidsynth asks for an import of fluidsynth, the old package gets is. Why is pyfluidsynth importing fluidsynth??? Why is fluidsynth still around, as there is no homepage anymore??? – Taylored Web Sites Oct 31 '21 at 15:54
0

I also had this problem with fluidsynth installation. I followed the following steps in Windows:

  • Install pyfluidsynth: pip install git+https://github.com/0xf0f/pyfluidsynth
  • Go to the path where fluidsynth has been installed: Ex.: C:\ProgramData\Anaconda3\Lib\site-packages and open fluidsynth.py file.
  • In the line of fluidsynth.py where it is written lib = find_library('fluidsynth') add find_library('libfluidsynth64')
  • Now download libfluidsynth64.dll and paste it in the path where you have fluidsynth installed: Ex.: C:\ProgramData\Anaconda3\Lib\site-packages

You can test if it works by running python, import fluidsynth and fuidsynth.Synth() in the Anaconda Prompt.