"ImportError: cannot import name 'QtMultimedia'" Picard 2.1.3 on Ubuntu 18.04

Picard wasn’t starting when I called it up via GUI. When I run picard from the cli I get

datakid@footscray:~$ picard 
Traceback (most recent call last):
  File "/usr/bin/picard", line 2, in <module>
    from picard.tagger import main; main('/usr/share/locale', False)
  File "/usr/lib/picard/picard/tagger.py", line 104, in <module>
    from picard.ui.mainwindow import MainWindow
  File "/usr/lib/picard/picard/ui/mainwindow.py", line 25, in <module>
    from PyQt5 import (
ImportError: cannot import name 'QtMultimedia'

I am using the latest version.

datakid@footscray:~$ apt show picard
Package: picard
Version: 2.1.3-1+git2838~ppa14~ubuntu18.04.1
Priority: optional
Section: sound
Maintainer: Philipp Wolfer <ph.wolfer@gmail.com>
Installed-Size: 5,661 kB
Depends: libc6 (>= 2.4), python3 (<< 3.7), python3 (>= 3.6~), python3-mutagen (>= 1.36), python3:any (>= 3.3.2-2~), python3-pyqt5 (>= 5.7), python3-discid (>= 1.0) | python3-libdiscid (>= 0.2.0), libchromaprint-tools
Download-Size: 977 kB
APT-Manual-Installed: yes
APT-Sources: http://ppa.launchpad.net/musicbrainz-developers/daily/ubuntu bionic/main amd64 Packages
Description: Next-Generation MusicBrainz audio files tagger
 Picard is the next generation MusicBrainz tagging application.
 .
 This new tagging concept is album oriented, as opposed to track oriented
 like the others taggers are.

N: There are 2 additional records. Please use the '-a' switch to see them.

You are using the latest development version, and the dependency to QtMultimedia was just merged. I have not yet updated the Debian build files, but this now needs a dependency on libqt5multimedia5-plugins. You can install this manually.

I will update the packaging, but this dependency will soon become optional again.

2 Likes

I have updated the packaging files and updated the PPA. If you update via apt now you should get the missing dependency installed.

There is a new player toolbar feature in this development build now. It’s disabled by default, but can be activated in the menu View > Player. Please keep in mind that this is a very early minimal implementation with basic functionality and there will be some improvements to it soon. As it currently looks like we will likely ship this with the next release but consider it a highly experimental / beta feature.

If you want to give it a test please do, feedback is welcomed. All credits for this new feature goes to timur-enikeev, but I don’t know if they have an account here (or which it is). Best way to give feedback is probably on the ticket:

2 Likes

Version 2.1.3-1+git2838~ppa16~ubuntu18.04.1, which has a dependency on libqt5multimedia5-plugins, still has this exact error. Something else must be missing.

1 Like

Oh, I think it also needs python3-pyqt5.qtmultimedia . I didn’t realize this again was in a separate package.

Can you try if installing this works and is sufficient? Then I will add it to the package dependency.

Relatedly, I’ve added qt5-multimedia to the optional dependencies of picard-git in the Arch User Repository (AUR). I was debating whether to make it as a full dependency and then change to an optional one once the follow‐up to actually make it optional goes in… but I went with this for now and hope that the follow‐up won’t take too long. :wink:

1 Like

Installed python3-pyqt5.qtmultimedia and everythings back to normal. Thx

1 Like

Thanks a lot for confirming this, updated packages are currently building. I currently don’t have a Ubuntu system with a newer Ubuntu for testing (I only have one with 16.04), but I probably should setup a VM for this finally…

I was thinking about this as well, but for Ubuntu it makes more sense to have it a required dependency for now. But I’m considering changing it to a “Recommends” (Debian packaging’s middle ground between absolutely required and purely optional). For most users this will mean they will still get those dependencies installed automatically by apt, but they have the possibility to opt out of it. Same would be true for discid and chromaprint support, which currently are also required in the Ubuntu package, but actually are optional.

Having QtMultimedia optional is currently WIP: https://github.com/metabrainz/picard/pull/1203

2 Likes

Yep - just installed latest update and it’s looking good. Thank you!

1 Like

The patch to make QtMultimedia optional was merged, and I have updated the Ubuntu packages to make it optional there as well. It is marked as Recommends, so apt will install it by default. But not installing it intentionally or uninstalling it later is now allowed.

This is now also the case for the chromaprint (enables fingerprinting) and python-discid (enables disc lookup) dependencies, so people not needing any of this can cut a few dependencies more if they want to.

3 Likes