In a new shiny ubuntu 18.04, I am trying to use a python3/pyqt5 script that use QtMultimedia.
It was working fine in 17.10. And now even after installing a bunch of package, I still can't get it to work. I have the following error when a QMediaplayer is instanciated:
defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
I assume it is an error because Qt5 and QtMultimedia can't find a proper backend registered right ?
I have all these package installed:
gir1.2-gstreamer-1.0 1.14.0-1
gstreamer1.0-alsa:amd64 1.14.0-2ubuntu1
gstreamer1.0-clutter-3.0:amd64 3.0.26-1
gstreamer1.0-fluendo-mp3:amd64 0.10.32.debian-1
gstreamer1.0-gl:amd64 1.14.0-2ubuntu1
gstreamer1.0-libav:amd64 1.14.0-1
gstreamer1.0-packagekit 1.1.9-1ubuntu2
gstreamer1.0-plugins-bad:amd64 1.14.0-1ubuntu1
gstreamer1.0-plugins-base:amd64 1.14.0-2ubuntu1
gstreamer1.0-plugins-base-apps 1.14.0-2ubuntu1
gstreamer1.0-plugins-good:amd64 1.14.0-1ubuntu1
gstreamer1.0-plugins-ugly:amd64 1.14.0-1
gstreamer1.0-pulseaudio:amd64 1.14.0-1ubuntu1
gstreamer1.0-python3-plugin-loader 1.14.0-1
gstreamer1.0-qt5:amd64 1.14.0-1ubuntu1
gstreamer1.0-tools 1.14.0-1
gstreamer1.0-vaapi:amd64 1.14.0-1
gstreamer1.0-x:amd64 1.14.0-2ubuntu1
libgstreamer1.0-0:amd64 1.14.0-1
libgstreamer-gl1.0-0:amd64 1.14.0-2ubuntu1
libgstreamer-plugins-bad1.0-0:amd64 1.14.0-1ubuntu1
libgstreamer-plugins-base1.0-0:amd64 1.14.0-2ubuntu1
libgstreamer-plugins-good1.0-0:amd64 1.14.0-1ubuntu1
libqt5core5a:amd64 5.9.5+dfsg-0ubuntu1
libqt5dbus5:amd64 5.9.5+dfsg-0ubuntu1
libqt5designer5:amd64 5.9.5-0ubuntu1
libqt5glib-2.0-0:amd64 1.2.0-5
libqt5gstreamer-1.0-0:amd64 1.2.0-5
libqt5gui5:amd64 5.9.5+dfsg-0ubuntu1
libqt5help5:amd64 5.9.5-0ubuntu1
libqt5multimedia5:amd64 5.9.5-0ubuntu1
libqt5multimediawidgets5:amd64 5.9.5-0ubuntu1
libqt5network5:amd64 5.9.5+dfsg-0ubuntu1
libqt5opengl5:amd64 5.9.5+dfsg-0ubuntu1
libqt5printsupport5:amd64 5.9.5+dfsg-0ubuntu1
libqt5qml5:amd64 5.9.5-0ubuntu1
libqt5quick5:amd64 5.9.5-0ubuntu1
libqt5sql5:amd64 5.9.5+dfsg-0ubuntu1
libqt5sql5-sqlite:amd64 5.9.5+dfsg-0ubuntu1
libqt5svg5:amd64 5.9.5-0ubuntu1
libqt5test5:amd64 5.9.5+dfsg-0ubuntu1
libqt5widgets5:amd64 5.9.5+dfsg-0ubuntu1
libqt5x11extras5:amd64 5.9.5-0ubuntu1
libqt5xml5:amd64 5.9.5+dfsg-0ubuntu1
libreoffice-avmedia-backend-gstreamer 1:6.0.3-0ubuntu1
python3-pyqt5 5.10.1+dfsg-1ubuntu2
python3-pyqt5.qtmultimedia 5.10.1+dfsg-1ubuntu2
qt5-gtk-platformtheme:amd64 5.9.5+dfsg-0ubuntu1
qtgstreamer-plugins-qt5:amd64 1.2.0-5
When I compare this list with the one I got on 17.10, I don't seem to miss any. So ?
I run the script with QT_DEBUG_PLUGINS=1
set, and I didn't see any error or problem.
Just solved my issue so maybe it will help you too.
Copy-past below:
The problem was that I had few two versions of
PyQt5
andsip
installed for Python3. One was in/usr/lib/python3/dist-packages/
and the other in~/.local/lib/python3.6/site-pacages/
. Completely deleting.local
versions helped.For anyone stumbling across this, here is the proper setup which will build Qt 5.11.2 as non-root, then install pyqt 5.11.2 with GStreamer 1.0 support on Ubuntu 18.04 into a virtual environment using python >= 3.6:
sudo apt install libpulse-dev
chmod +x qt-unified-linux-x64-3.0.5-online.run
). Click through the wizard. I'm assuming you are installing to$HOME/Qt
python -m venv venv
.source venv/bin/activate
python configure.py -d ../venv/lib/python3.6/site-packages
make -j4
make install
python configure.py -d ../venv/lib/python3.6/site-packages --sip-module PyQt5.sip --no-tools
make -j4
make install
python configure.py --destdir ../venv/lib/python3.6/site-packages --qmake ~/Qt/5.11.2/gcc_64/bin/qmake --sip ../venv/bin/sip
make -j12
make install
That should be it now. Based on http://pyqt.sourceforge.net/Docs/PyQt5/installation.html, http://pyqt.sourceforge.net/Docs/sip4/installation.html and a lot of trial and error. If something does not work, I recommend using
--verbose
during the configuration step of PyQt.