Here's specifically how I was able to cure my phonon backend plugin error (on Mac OS X, etc., all listed above):
In the main method of my application's script, I added a library path to include a folder named "Plugins." Thus my main method looks like this:
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
QtGui.QApplication.addLibraryPath(QtGui.QApplicati on.applicationDirPath() + "/../Plugins")
app.setApplicationName("Music Player")
form = radioUI()
form.show()
sys.exit(app.exec_())
Then I manually copy (every time I run py2app) the phonon_backend directory into a Plugins directory in my application. There may be a better way to do this, but this is how I do it.
What this means in practice:
- Search for the "phonon_backend" directory in your Qt installation. On my machine, it was in "~/Trolltech/Qt-4.4.3/plugins/phonon_backend." This directory should contain two files:
------ libphonon_qt7_debug.dylib
------ libphonon_qt7.dylib
(I'm not sure if you need both of these -- I take both just for safety.)
- Make a folder named "Plugins" somewhere and copy the "phonon_backend" directory into it. I make the "Plugins" folder on my desktop, so the resulting directory is "~/Desktop/Plugins/phonon_backend/" and contains the two *.dylib files listed above.
- Run py2app normally (assuming it runs normally for you).
- "Show Package Contents" of the resulting application. You should see a structure like
Contents
--- Frameworks
--- info.plist
--- MacOS
--- PkgInfo
--- Resources
- Copy your "Plugins" directory into the Contents folder. The resulting structure should look like
Contents
--- Frameworks
--- info.plist
--- MacOS
--- PkgInfo
--- Plugins
--- Resources
That should do it.
Let me know if this is unclear or doesn't work for you. I was so happy to get past the backend plugin error.
Of course, now I'm on to a threading error...![]()
Yeah I have followed your instructions but the app still crashes whenever I try to use phonon. Hopefully I will have better luck eventually.
FWIW, I got around the backend-plugin error with this fix, but I still had a threading error which prevented my application from actually playing audio. After much, much trying, I eventually learned that phonon's thread used a Qt object not registered with PyQt -- and definitively I could not access the object from python to register it!
I eventually abandoned phonon, implemented everything I needed (asynchronous playback, seekSlider) using pyaudio and wave -- which are both built-in to python -- and deployed a working application.
I spent five weeks trying to deploy a working python application with phonon, and I couldn't make it happen. If you succeed, God bless you -- you're a better developer than I!![]()
Also FWIW, I had to recopy that Plugins directory (described in #5) after *every time* I ran py2app. Not a great workaround, I know...
Bookmarks