I have prepared an SRU for resolute (pyqt6 6.10.2-2ubuntu0.1); the debdiff
is attached. It backports the Debian 6.11.0-2 change, which moves PyQt6/uic
from pyqt6-dev-tools to python3-pyqt6, and adds
Breaks/Replaces: pyqt6-dev-tools (<< 6.10.2-2ubuntu0.1~).

I tested it in a clean resolute LXD container, installing locally built
binaries from a local apt repository.

Test 1 (only software-properties-qt installed):
- With 6.10.2-2build5, "from PyQt6 import uic" fails with ImportError.
- After "apt install --only-upgrade python3-pyqt6", one package is
  upgraded, dpkg -S shows uic owned by python3-pyqt6, and the import works.

Test 2 (pyqt6-dev-tools 6.10.2-2build5 installed and owning uic):
- "apt install --only-upgrade python3-pyqt6" upgrades both python3-pyqt6
  and pyqt6-dev-tools (Breaks), with no "trying to overwrite" errors.
- uic is now owned by python3-pyqt6, and dpkg --audit and apt-get check
  are clean.
- pyuic6 --version prints 6.10.2.
- Importing softwareproperties.qt.SoftwarePropertiesQt works.

The fix belongs to pyqt6, so the software-properties task can probably be
closed.

Could a sponsor please review and upload this, and add a Resolute series
task?

Side note: on a minimal install, software-properties-qt also fails with
"No module named 'UbuntuDrivers'". Unlike software-properties-gtk, it does
not depend on ubuntu-drivers-common. I will file that as a separate bug.

** Description changed:

+ [ Impact ]
+ 
+  * On resolute, the PyQt6.uic module is shipped in pyqt6-dev-tools instead
+    of python3-pyqt6. Applications that use it at runtime fail with
+    "ImportError: cannot import name 'uic' from 'PyQt6'". For example,
+    software-properties-qt crashes at startup on a default Kubuntu 26.04
+    installation unless pyqt6-dev-tools is installed by hand.
+ 
+  * This is fixed in the development release (Debian 6.11.0-2, present in
+    stonking as 6.11.0-3build1) by moving uic to python3-pyqt6. This SRU
+    backports the same packaging change, together with the
+    Breaks/Replaces that the file move requires.
+ 
+ [ Test Plan ]
+ 
+  1. On resolute, without pyqt6-dev-tools:
+       apt install software-properties-qt
+       python3 -c "from PyQt6 import uic"      # fails: ImportError
+     Upgrade python3-pyqt6 from -proposed, then check:
+       dpkg -S /usr/lib/python3/dist-packages/PyQt6/uic   # python3-pyqt6
+       python3 -c "from PyQt6 import uic"                 # works
+       software-properties-qt starts
+ 
+  2. Upgrade path with the old pyqt6-dev-tools installed:
+       apt install pyqt6-dev-tools        # from -updates
+       apt install --only-upgrade python3-pyqt6   # from -proposed
+     apt must upgrade pyqt6-dev-tools as well (Breaks). There must be no
+     "trying to overwrite" error. dpkg --audit and apt-get check must be
+     clean, and pyuic6 --version must still work.
+ 
+ [ Where problems could occur ]
+ 
+  * The change moves files between binary packages. Wrong Breaks/Replaces
+    could make upgrades fail with dpkg "trying to overwrite" errors, or
+    leave the module missing. Test 2 covers this.
+  * Users who have pyqt6-dev-tools installed get it upgraded together with
+    python3-pyqt6. The file contents do not change; only their owning
+    package does.
+  * No code changes. python3-pyqt6 grows slightly (uic is pure Python).
+ 
+ [ Other Info ]
+ 
+  * Both test cases pass in a clean resolute LXD container with locally
+    built binaries (see the comment below). The debdiff is attached.
+ 
+ [ Original Description ]
+ 
  I cannot run `software-properties-qt` immediately after apt-installing
  it on Kubuntu 26.04.
  
  # Expected behavior
  
  It should not crash
  
  # Actual behavior
  
  ```console
  home@daniel-desktop3:~$ GDK_BACKEND=wayland software-properties-qt
  Traceback (most recent call last):
-   File "/usr/bin/software-properties-qt", line 36, in <module>
-     from softwareproperties.qt.SoftwarePropertiesQt import 
SoftwarePropertiesQt
-   File 
"/usr/lib/python3/dist-packages/softwareproperties/qt/SoftwarePropertiesQt.py", 
line 37, in <module>
-     from PyQt6 import uic
+   File "/usr/bin/software-properties-qt", line 36, in <module>
+     from softwareproperties.qt.SoftwarePropertiesQt import 
SoftwarePropertiesQt
+   File 
"/usr/lib/python3/dist-packages/softwareproperties/qt/SoftwarePropertiesQt.py", 
line 37, in <module>
+     from PyQt6 import uic
  ImportError: cannot import name 'uic' from 'PyQt6' 
(/usr/lib/python3/dist-packages/PyQt6/__init__.py)
  ```
  
  # Workaround
  
  ```bash
  sudo apt install pyqt6-dev-tools
  ```
  
  # Analysis
  
  Please adjust the packaging of python3-pyqt6. Either:
  * Soften the hard-dependency on uic
  * Merge package pyqt6-dev-tools with package python3-pyqt6
  * Add `Depends: pyqt6-dev-tools` to python3-pyqt6's control
  
  ProblemType: Bug
  DistroRelease: Ubuntu 26.04
  Package: software-properties-qt 0.120
  ProcVersionSignature: Ubuntu 7.0.0-15.15-generic 7.0.0
  Uname: Linux 7.0.0-15-generic x86_64
  ApportVersion: 2.34.0-0ubuntu2
  Architecture: amd64
  CasperMD5CheckResult: pass
  CurrentDesktop: KDE
  Date: Mon May 25 19:31:05 2026
  InstallationDate: Installed on 2022-11-05 (1298 days ago)
  InstallationMedia: Ubuntu 22.10 "Kinetic Kudu" - Release amd64 (20221020)
  PackageArchitecture: all
  SourcePackage: software-properties
  UpgradeStatus: Upgraded to resolute on 2026-04-24 (32 days ago)

** Patch added: "debdiff for resolute (pyqt6 6.10.2-2ubuntu0.1)"
   
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/2154237/+attachment/6016193/+files/pyqt6_6.10.2-2ubuntu0.1.debdiff

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2154237

Title:
  ImportError: cannot import name 'uic' from 'PyQt6'

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pyqt6/+bug/2154237/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to