[PyQt] Phonon import error

Hans-Peter Jansen hpj at urpla.net
Wed Nov 17 22:43:56 GMT 2010


[added ML again, this might be of public interest.]

On Wednesday 17 November 2010, 22:37:47 Gionata Boccalini wrote:
> Thanks! I am using your repo now...
> I have upgraded PyQt, Sip and Scintilla packages (because of Eric
> IDE) and....
> it takes me half an hour to get the correct import line!!!!!
> So I'm using
> from PyQt4.phonon import Phonon
>
> and then in the code
>
> media = Phonon.MediaSource("...")
>
> Maybe there is a better import mode, but the other forms are not
> working! At least I can see some videos in a Qt widget now!!!
> Thanks!!!

Your approach looks sane. You might have noticed the examples from the 
python-qt4-devel packages here:

/usr/share/doc/packages/python-qt4-devel/examples/phonon

although it only performs a simple music player.

I guess, Phil wouldn't mind, if you enhance it to play videos, too.

> Where do I have to write the note you were talking about??

Done hereby. Thanks.

Pete

> Gionata Boccalini
>
> Il 17/11/2010 14:34, Hans-Peter Jansen ha scritto:
> > Dear Gionata,
> >
> > On Tuesday 16 November 2010, 21:34:18 Gionata Boccalini wrote:
> >> Hi everyone, first post to this mailing list!
> >> I have been having a problem importing Phonon module in a PyQt GUI
> >> application. The result is
> >>
> >>   >>>  from PyQt4 import Phonon
> >>
> >> Traceback (most recent call last):
> >>     File "<stdin>", line 1, in<module>
> >> ImportError: cannot import name Phonon
> >>
> >> I am using opensuse 11.3 with python v2.6.5, Qt v4.6.3  and PyQt
> >> v4.7.3, precompiled from the standard repo. I know about a bug in
> >> PyQt package in opensuse, which doesn't include the phonon
> >> module!!! Thus how can I get it?? Do I have to build Pyqt from
> >> source?? Will that fix my problem?? Thanks!!!!!!!!!!!!!!!!!!
> >
> > You may want to try mine:
> >
> > http://download.opensuse.org/repositories/home:/frispete:/PyQt/open
> >SUSE_11.3/
> >
> > Depending on your KDE/Qt version, I've other flavors as well, e.g.
> > if you want to Qt 4.7.1, you should add the KDE:Distro:Factory repo
> > (and you will get KDE 4.5.3 for free ;-) )..
> >
> > All it took was adding the missing phonon{,-devel} dependencies,
> > BTW.
> >
> > If you use these packages, a short note would be nice (even for the
> > successful case), thanks.
> >
> > Pete
> > _______________________________________________
> > PyQt mailing listPyQt at riverbankcomputing.com
> > http://www.riverbankcomputing.com/mailman/listinfo/pyqt




More information about the PyQt mailing list