How to install Kirigami for (K)Ubuntu (Kirigami with Python)

Hi all,

I am programming with Python on Linux as a hobby and have done some small GUI applications with Qt (PySide6). Working with Linux/Kubuntu, I want to use kirigami with my Python Qt apps but the installation guide for Kirigami lacks the necessary information for Debian/Ubuntu based distros.

Can someone help me installing kirigami here? At the moment, import org.kde.kirigami as Kirigami fails. Thanks a lot!

The reason why it’s like this is that back when I updated it 24.04 wasn’t out yet, and:

  • Kubuntu had only just released PyQt6 with 23.10 (much less users than LTS)
  • even now Kubuntu doesn’t have PySide6
  • even now Kubuntu doesn’t have Qt6 Kirigami

Which makes this a tad complicated to support (that is, we cannot). I’ll see that I update the tutorial with at least a few potential solutions or with a note explaining how to learn it regardless, I’ll need to test a few things first (I vaguely recall trying the PyQt tutorial with distrobox back then for example).

Your best bet will probably be to resort to the Qt5 version for now: Python with Kirigami | Developer

You might also want to take a look at Port PyQt tutorial to Qt6 (!361) · Merge requests · Documentation / Developer Tutorial and Article Site · GitLab for a few other changes that were fixed during the port.

The package list should be fairly similar to the PyQt version, just replacing pyqt5 with pyside2. So something like that:

python3-pyside2 python3-pyside2.qtquick python3-venv kirigami2-dev flatpak-builder libkf5qqc2desktopstyle-dev appstream-compose

Thanks a lot for your helpful reply.

I am not restricted to PySide6, I’d have no problems migrating to PyQt6 if that worked for Kubuntu 23.10 and later. In this case, how would I install kirigami for working with PyQt6 on Kubuntu? Thanks again!

Is Kirigami actually possible with PyQt6 on Ubuntu 22.04 or is a release of Kirigami for Ubuntu 22.04 still required/open? Thanks!

Oh oops, I missed this message.

Generally the same list mentioned in Your first PyQt + Kirigami application | Developer, but with 6. :stuck_out_tongue:

But only Ubuntu 24.04 has those.

If you have any problems trying to find the right package you can mention those here.

The packages need to be in the distribution you’re using, yes. I believe PyQt6 is only in Ubuntu 24.04.

However, as I’ve recently added to Your first Python + Kirigami application | Developer, you can bypass that by using Distrobox. I tested it and it works.

All you need to do is set up distrobox with some up-to-date distro, enter the distrobox, and perform the same commands as the tutorial from within that shell.

With this, it doesn’t matter which version of Ubuntu you’re using (as long as you can run distrobox). And both PyQt6 and PySide6 will be doable.