Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: No module named 'pyFluidSynth' #20

Closed
RZz96 opened this issue Feb 12, 2019 · 5 comments
Closed

Error: No module named 'pyFluidSynth' #20

RZz96 opened this issue Feb 12, 2019 · 5 comments

Comments

@RZz96
Copy link

RZz96 commented Feb 12, 2019

i have installed pyFluidSynth using pip but by import pyFluidSynth give an error :ModuleNotFoundError: No module named 'pyFluidSynth'.
also if i import fluidsynth the i get the error ImportError: Couldn't find the FluidSynth library.

@ChristianRomberg
Copy link
Collaborator

ChristianRomberg commented Feb 12, 2019 via email

@RZz96
Copy link
Author

RZz96 commented Feb 12, 2019

Thank you for the reply :)

i tried this one and i got error : AttributeError: 'module' object has no attribute 'Synth'

import time
import fluidsynth

fs = fluidsynth.Synth()
fs.start()

sfid = fs.sfload("example.sf2")
fs.program_select(0, sfid, 0, 0)

fs.noteon(0, 60, 30)
fs.noteon(0, 67, 30)
fs.noteon(0, 76, 30)

time.sleep(1.0)

fs.noteoff(0, 60)
fs.noteoff(0, 67)
fs.noteoff(0, 76)

time.sleep(1.0)

fs.delete()

@SpotlightKid
Copy link

Don't name one of your own modules / scripts fluidsynth.py

@digimbyte
Copy link

digimbyte commented Jul 28, 2020

I have this same issue, my script is called player.py
I have installed FluidSynth with apt install fluidsynth for debian and can run it from console directly.
Runing the py script yeilds the error Module FluidSynth not found

Update: it might be that PyFluidSynth is just not compatible with FluidSynth 2 (latest)
using Python3.4 on debian jessie (cant update)

@albedozero
Copy link
Collaborator

@RZz96 and @digimbyte there is some understandable confusion because there's another, somewhat older package on PyPi called fluidsynth which is not maintained here and does not have a Synth object. Also, to install pyfluidsynth you would type at the command line

pip install pyfluidsynth

but to use in your code you would add at the top

import fluidsynth

@albedozero albedozero changed the title problem with pyFluidSynth Error: No module named 'pyFluidSynth' Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants