Bug 1164511

Summary: python3-qt5: dbus.mainloop.pyqt5 fails to import (causes issues with Cadence from Multimedia:apps)
Product: [openSUSE] openSUSE Tumbleweed Reporter: Marc Joliet <marcec>
Component: OtherAssignee: E-mail List <bnc-team-screening>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: wbauer
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: Linux   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Marc Joliet 2020-02-20 17:58:07 UTC
I use Cadence from Multimedia:apps for managing JACK.  This used to work up to November 2019, but I recently tried it again and it complains that dbus is not available (which is nonsense).  It turns out that the way it tests this is via a try/except block:

try:
    import dbus
    from dbus.mainloop.pyqt5 import DBusQtMainLoop
    haveDBus = True
except:
    haveDBus = False

the "from ... import ..." line is what fails and causes the error message I see.  The bizarre thing is that that module is installed:

% rpm --query --list python3-qt5 | grep -i mainloop
/usr/lib64/python3.7/site-packages/dbus/mainloop
/usr/lib64/python3.7/site-packages/dbus/mainloop/pyqt5.so

If I run python3 myself, I can successfully import dbus and dbus.mainloop, but not dbus.mainloop.pyqt5:

% python3
Python 3.7.3 (default, Apr 09 2019, 05:18:21) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbus
>>> import dbus.mainloop
>>> import dbus.mainloop.pyqt5
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'dbus.mainloop.pyqt5'
>>>

And here I am stumped.  I don't know enough about how Python loads C extension modules to be able to debug this further.  At least it's not something trivial like a missing symbol...

Seems this is a problem on other distros, too: https://stackoverflow.com/questions/56462559/no-module-named-dbus-mainloop-pyqt5-even-if-all-dependencies-seem-to-be-instal.  However, on my Gentoo desktop it works fine:

% python3
Python 3.6.9 (default, Oct 12 2019, 14:38:00) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbus.mainloop.pyqt5
>>> 

Some system info:

% cat /etc/os-release 
NAME="openSUSE Tumbleweed"
# VERSION="20200218"
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20200218"
PRETTY_NAME="openSUSE Tumbleweed"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:tumbleweed:20200218"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
LOGO="distributor-logo"

% env LANG=C zypper info python3-qt5
Loading repository data...
Reading installed packages...


Information for package python3-qt5:
------------------------------------
Repository     : openSUSE-Tumbleweed-Oss   
Name           : python3-qt5               
Version        : 5.13.2-2.2                
Arch           : x86_64                    
Vendor         : openSUSE                  
Installed Size : 22.7 MiB                  
Installed      : Yes (automatically)       
Status         : up-to-date                
Source package : python3-qt5-5.13.2-2.2.src
Summary        : Python bindings for Qt 5  
Description    :                           
    PyQt is a set of Python bindings for the Qt framework.

The version of PyQt5 on my Gentoo system is the same (5.13.2), but as can be seen above, I'm still on Python 3.6 there.
Comment 1 Wolfgang Bauer 2020-02-20 18:06:03 UTC
A fix is on the way already:
https://build.opensuse.org/request/show/775006

*** This bug has been marked as a duplicate of bug 1163755 ***
Comment 2 Marc Joliet 2020-02-20 20:45:06 UTC
Cool, thanks!  (I searched for various things before opening this bug, but apparently not for dbus.mainloop.pyqt5, sorry.)