Launchpad has imported 13 comments from the remote bug at
https://bugs.kde.org/show_bug.cgi?id=518163.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://documentation.ubuntu.com/launchpad/user/reference/bugs/multi-project-bugs/about-multi-project-bugs/#bugs-in-external-trackers.

------------------------------------------------------------------------
On 2026-03-26T12:57:14+00:00 K-nick-a wrote:

Created attachment 191029
My really dumb patch to fix this

***
If you're not sure this is actually a bug, instead post about it at 
https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see
https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
https://invent.kde.org/graphics/krita/-/commit/38bbeb8a1882150379fafde54f25222e5fade146
This commit introduced a way to dynamically load either PyQT5 or PyQT6, but 
ends up removing /usr/lib/python3.14/site-packages from sys.path, breaking all 
built-in plugins. 

STEPS TO REPRODUCE
1. Lauch Krita 6.0.0-1 on Arch or CachyOS 
2. Open settings and observe broken plugins

OBSERVED RESULT
No plugins can be loaded

EXPECTED RESULT
Built-in plugins available

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: ArchLinux 
KDE Frameworks Version: 25.12.3-1.1
Qt Version: 6.10.2-1

ADDITIONAL INFORMATION
https://dpaste.com/5LLS6GZZ5

Reply at:
https://bugs.launchpad.net/ubuntu/+source/krita/+bug/2163676/comments/0

------------------------------------------------------------------------
On 2026-03-26T17:46:28+00:00 Bug-janitor wrote:

A possibly relevant merge request was started @
https://invent.kde.org/graphics/krita/-/merge_requests/2723

Reply at:
https://bugs.launchpad.net/ubuntu/+source/krita/+bug/2163676/comments/1

------------------------------------------------------------------------
On 2026-03-26T17:47:45+00:00 Penguinflyer2222 wrote:

Is this is with a distro build relying on system site-packages where
there happen to be two version of PyQt installed?

Krita is looking for PyQt6 but found PyQt5 and tried to remove that. (The error 
message which says it can't find the Qt5 bindings is misleading.)
Re-adding the system site-packages would re-add PyQt5, which would crash Krita 
if accessed by outdated user plugins. (Built-in plugins prioritize PyQt6, so 
they only crash the other way around.)

I have a potential fix in the above merge request which is built on those 
assumptions.
It re-adds the other modules beside where the conflicting PyQt was found.
So if PyQt5 and PyQt6 were in the same site-packages folder, it would be able 
to find the right one.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/krita/+bug/2163676/comments/2

------------------------------------------------------------------------
On 2026-03-26T17:49:49+00:00 K-nick-a wrote:

(In reply to Freya Lupen from comment #2)
> Is this is with a distro build relying on system site-packages where there
> happen to be two version of PyQt installed?
> 
> Krita is looking for PyQt6 but found PyQt5 and tried to remove that. (The
> error message which says it can't find the Qt5 bindings is misleading.)
> Re-adding the system site-packages would re-add PyQt5, which would crash
> Krita if accessed by outdated user plugins. (Built-in plugins prioritize
> PyQt6, so they only crash the other way around.)
> 
> I have a potential fix in the above merge request which is built on those
> assumptions.
> It re-adds the other modules beside where the conflicting PyQt was found.
> So if PyQt5 and PyQt6 were in the same site-packages folder, it would be
> able to find the right one.

Yes, both python-pyqt6 and python-pyqt5 are installed at the same time,
you're correct

Reply at:
https://bugs.launchpad.net/ubuntu/+source/krita/+bug/2163676/comments/3

------------------------------------------------------------------------
On 2026-03-27T04:41:48+00:00 Dra-w-p-il-e+bugskde wrote:

*** Bug 518195 has been marked as a duplicate of this bug. ***

Reply at:
https://bugs.launchpad.net/ubuntu/+source/krita/+bug/2163676/comments/4

------------------------------------------------------------------------
On 2026-03-27T07:22:53+00:00 K-nick-a wrote:

https://dpaste.com/GDXHL8SX6
I tried using __init__.py from this MR - 
https://invent.kde.org/graphics/krita/-/merge_requests/2723
It looks like it's not fixing the issue. 
If importlib.util.find_spec("PyQt5") returns None, the os.scandir never runs. 
So PyQt6 is not going to be imported.
I've made another patch based on that MR that, once again, fixes this on my 
system. (attaching as new.patch)

Reply at:
https://bugs.launchpad.net/ubuntu/+source/krita/+bug/2163676/comments/5

------------------------------------------------------------------------
On 2026-03-27T07:23:32+00:00 K-nick-a wrote:

Created attachment 191055
new patch based on !2723

Reply at:
https://bugs.launchpad.net/ubuntu/+source/krita/+bug/2163676/comments/6

------------------------------------------------------------------------
On 2026-03-27T16:52:17+00:00 Dra-w-p-il-e+bugskde wrote:

*** Bug 518233 has been marked as a duplicate of this bug. ***

Reply at:
https://bugs.launchpad.net/ubuntu/+source/krita/+bug/2163676/comments/7

------------------------------------------------------------------------
On 2026-03-27T20:40:36+00:00 Penguinflyer2222 wrote:

I've updated the MR to remove the sys.path modifications, could you test
if it works now?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/krita/+bug/2163676/comments/8

------------------------------------------------------------------------
On 2026-03-27T20:44:00+00:00 K-nick-a wrote:

(In reply to Freya Lupen from comment #8)
> I've updated the MR to remove the sys.path modifications, could you test if
> it works now?

It does! Thank you.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/krita/+bug/2163676/comments/9

------------------------------------------------------------------------
On 2026-03-28T08:17:49+00:00 Dra-w-p-il-e+bugskde wrote:

*** Bug 518249 has been marked as a duplicate of this bug. ***

Reply at:
https://bugs.launchpad.net/ubuntu/+source/krita/+bug/2163676/comments/10

------------------------------------------------------------------------
On 2026-04-01T09:25:22+00:00 Dmitry Kazakov wrote:

Git commit f6d7040613dd49aa47e74f7c55590f3e553125c9 by Dmitry Kazakov, on 
behalf of Freya Lupen.
Committed on 01/04/2026 at 09:09.
Pushed by dkazakov into branch 'master'.

Disallow importing conflicting version of PyQt

This replaces the sys.path modification with a better hack.
Now we simply override builtins.__import__ to raise
a ModuleNotFoundError if an attempt is made to load the wrong PyQt.

M  +15   -16   plugins/extensions/pykrita/plugin/krita/__init__.py

https://invent.kde.org/graphics/krita/-/commit/f6d7040613dd49aa47e74f7c55590f3e553125c9

Reply at:
https://bugs.launchpad.net/ubuntu/+source/krita/+bug/2163676/comments/11

------------------------------------------------------------------------
On 2026-04-01T09:25:53+00:00 Dmitry Kazakov wrote:

Git commit 731367f8245dcc3889ad6445d6da426432c5bfc8 by Dmitry Kazakov, on 
behalf of Freya Lupen.
Committed on 01/04/2026 at 09:25.
Pushed by dkazakov into branch 'krita/6.0'.

Disallow importing conflicting version of PyQt

This replaces the sys.path modification with a better hack.
Now we simply override builtins.__import__ to raise
a ModuleNotFoundError if an attempt is made to load the wrong PyQt.

M  +15   -16   plugins/extensions/pykrita/plugin/krita/__init__.py

https://invent.kde.org/graphics/krita/-/commit/731367f8245dcc3889ad6445d6da426432c5bfc8

Reply at:
https://bugs.launchpad.net/ubuntu/+source/krita/+bug/2163676/comments/12


** Changed in: krita
       Status: Unknown => Fix Released

** Changed in: krita
   Importance: Unknown => Medium

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

Title:
  Krita 6.0.1 Python scripting broken when PyQt5 and PyQt6 are installed

To manage notifications about this bug go to:
https://bugs.launchpad.net/krita/+bug/2163676/+subscriptions


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

Reply via email to