Since some time before nightly build 27678b4ca0 (#494), PyQt5 is not detected when building Krita. [2019-03-23T08:22:39.918Z] File "C:/Packaging/workspace/Krita_Nightly_Windows_Build/krita/cmake/modules/FindPyQt5.py", line 9, in <module> [2019-03-23T08:22:39.918Z] print("pyqt_version:%06.0x" % PyQt5.Qt.PYQT_VERSION) [2019-03-23T08:22:39.918Z] AttributeError: module 'PyQt5.Qt' has no attribute 'PYQT_VERSION' I suspect it needs to be PyQt5.QtCore.PYQT_VERSION instead, but I don't know if it is a change since some version of PyQt5 or if there is a bug in the toolchain. Anyway, whatever change to this will need to be verified on all platforms.
Finding your PyQT isn't the issue, it's that there seems to be something weird about it. I cannot reproduce this with PyQT 5.9.2 nor the most recent 5.12.1. Which version of PyQT are you building against?
This is the nightly Windows build, so it's using the 3rdpary/ext_pyqt definition, which uses https://www.riverbankcomputing.com/static/Downloads/PyQt5/PyQt5_gpl-5.12.1.zip
If PyQt5.QtCore.PYQT_VERSION works for that version, there is no reason not to switch to that. In fact, it seems to be the cleaner solution as it looks like that is where PYQT_VERSION etc are defined in the first place. Works on both my installations.
So it looks like PyQt5 is now requiring a private copy of the sip module. From the changelog: 2018-06-17 Phil Thompson <phil@riverbankcomputing.com> * lib/configure.py, rb-product: Use a private copy of the sip module. SIP v4.19.9 is now required. [7c9bae40b66c] Simply copying the `sip.pyd` into `PyQt5/` doesn't seem to work (resulted in `ValueError: PyCapsule_GetPointer called with incorrect name`). As Ivanyossi pointed out on IRC, according to the docs [1], I need to add `--sip-module PyQt5.sip` to configure sip. However, in this case it doesn't install the "legacy" top-level `sip` module unlike what the docs seem to imply, even though the `--no-module` option wasn't passed. With this change, Krita can again compile with Python scripting and the scripts does seem to work. But I can find two places in Krita that tries to `import sip` [2] [3] and I can't tell if they would be working as expected with this change. I also found that Boud had made this change in the past but backed out of it [4]. Boud, do you remember why you backed out of it? [1]: https://www.riverbankcomputing.com/static/Docs/sip/installation.html#ref-private-sip [2]: https://github.com/KDE/krita/blob/44080b7b7af892e410bf3bb5b2f19ea785f760fb/plugins/extensions/pykrita/plugin/krita/attic/mikro.py#L30 [3]: https://github.com/KDE/krita/blob/44080b7b7af892e410bf3bb5b2f19ea785f760fb/plugins/extensions/pykrita/plugin/utilities.cpp#L92 [4]: https://github.com/KDE/krita/commit/93a2b48e3a0bf1251deaaf84263a76d846c39cef
mikro.py isn't used atm, as far as I remember. I'm not sure why I removed the private sip stuff; I think I was only experimenting with it.
(In reply to Boudewijn Rempt from comment #5) > mikro.py isn't used atm, as far as I remember. I'm not sure why I removed > the private sip stuff; I think I was only experimenting with it. Ok. Should I be worried of that piece of code with `import sip` in utilities.cpp? It looks like it's setting some parameters, but I don't know what it actually does.
That's a bit of a poser. For Python 3, we don't need that code, since the new API is selected by default in python 3. But we're vaguely compatible with Python 2, where this is needed.
Git commit 331beffd5332ecfed95a8ca4ba2bfee56fedad47 by Alvin Wong. Committed on 26/03/2019 at 09:24. Pushed by alvinwong into branch 'master'. Fix Python scripting broken by new pyqt and sip PyQt5 started requiring a private copy of the sip module, so we have to build sip as a private sip module for PyQt5. M +2 -1 3rdparty/ext_sip/CMakeLists.txt M +3 -0 plugins/extensions/pykrita/plugin/krita/attic/mikro.py M +4 -0 plugins/extensions/pykrita/plugin/utilities.cpp https://commits.kde.org/krita/331beffd5332ecfed95a8ca4ba2bfee56fedad47