Bug 396381

Summary: PyKrita doesn't load with PyQt 5.11
Product: [Applications] krita Reporter: Antonio Rojas <arojas>
Component: ScriptingAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR    
Version: 4.1.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Antonio Rojas 2018-07-10 21:44:04 UTC
Python plugins don't work with PyQt 5.11. For some reason beyond my understanding the PyQt developer decided that PyQt must now use a private copy of sip [1], and that seems to confuse krita, which still uses the shared sip. 

krita.scripting: "Traceback (most recent call last):"
krita.scripting: "  File \"/usr/lib/krita-python-libs/krita/__init__.py\", line 7, in <module>"
krita.scripting: "    from .api import *"
krita.scripting: "  File \"/usr/lib/krita-python-libs/krita/api.py\", line 28, in <module>"
krita.scripting: "    from PyKrita.krita import *"
krita.scripting: "RuntimeError: the PyQt5.QtCore module failed to register with the sip module"
krita.scripting: "Could not import krita"

Tried rebuilding krita with PyQt 5.11, didn't help.

[1] https://www.riverbankcomputing.com/pipermail/pyqt/2018-June/040421.html
Comment 1 Halla Rempt 2018-07-10 21:50:45 UTC
I don't get it either -- please either provide a patch, or complain to Phil. I currentlly don't have a system where I can reproduce the problem, and until my distribution updates to that, I won't look into it.
Comment 2 Antonio Rojas 2018-07-11 22:20:44 UTC
Patch at https://phabricator.kde.org/D14061
Comment 3 Antonio Rojas 2018-07-12 13:32:53 UTC
Git commit 1df7bb73ff491176faf0fc9fa3f54b9bda9e36d1 by Antonio Rojas.
Committed on 12/07/2018 at 13:32.
Pushed by arojas into branch 'master'.

Fix loading PyKrita with PyQt 5.11

PyQt>=5.11 uses its own private copy of SIP, with sipName PyQt5.sip. This causes an API mismatch with the Krita python module, which uses the default "sip" sipName, and the module fails to load. This patch fixes this by using the PyQt5.sip sipName for PyQt>=5.11

Differential Revision: https://phabricator.kde.org/D14061

M  +5    -1    plugins/extensions/pykrita/sip/CMakeLists.txt

https://commits.kde.org/krita/1df7bb73ff491176faf0fc9fa3f54b9bda9e36d1
Comment 4 Antonio Rojas 2018-07-12 13:33:43 UTC
Git commit a9be187ab3ff0b682c33b25d4db9e22cd8ceff3e by Antonio Rojas.
Committed on 12/07/2018 at 13:33.
Pushed by arojas into branch 'krita/4.1'.

Fix loading PyKrita with PyQt 5.11

PyQt>=5.11 uses its own private copy of SIP, with sipName PyQt5.sip. This causes an API mismatch with the Krita python module, which uses the default "sip" sipName, and the module fails to load. This patch fixes this by using the PyQt5.sip sipName for PyQt>=5.11

Differential Revision: https://phabricator.kde.org/D14061

M  +5    -1    plugins/extensions/pykrita/sip/CMakeLists.txt

https://commits.kde.org/krita/a9be187ab3ff0b682c33b25d4db9e22cd8ceff3e
Comment 5 Andrey 2018-07-19 11:30:35 UTC
Git commit 7ce778846757b597e8372fcb9a9519a8418d61b0 by Andrey Kamakin, on behalf of Antonio Rojas.
Committed on 19/07/2018 at 11:14.
Pushed by akamakin into branch 'akamakin/T8628-multithreading-optimization'.

Fix loading PyKrita with PyQt 5.11

PyQt>=5.11 uses its own private copy of SIP, with sipName PyQt5.sip. This causes an API mismatch with the Krita python module, which uses the default "sip" sipName, and the module fails to load. This patch fixes this by using the PyQt5.sip sipName for PyQt>=5.11

Differential Revision: https://phabricator.kde.org/D14061

M  +5    -1    plugins/extensions/pykrita/sip/CMakeLists.txt

https://commits.kde.org/krita/7ce778846757b597e8372fcb9a9519a8418d61b0