You are not logged in.

#1 2021-06-23 04:40:24

ShnorpSinkledonk
Member
Registered: 2021-02-06
Posts: 19

[Solved] Compiling ki18n-git - "ImportError: No module named PyQt5.Qt"

Hello,

I am trying to compile a package that requires "ki18n-git" (whatever that is), and it does not build. The error that I get is:

Traceback (most recent call last):
  File "/usr/share/ECM/find-modules/run-sip.py", line 10, in <module>
    from PyQt5.Qt import PYQT_CONFIGURATION
ImportError: No module named PyQt5.Qt

If I open a Python 3 prompt, I can import PyQt5 just fine. But this script seems to be executed by Python 2, which indeed does not have PyQt5.
However, there is no longer a 'python2-pyqt5' package in the repos, which means I'm stuck with this error.

Does anyone know how to fix this? And why is Python 2 still used in the newest version of ECM?

Thank you.

Last edited by ShnorpSinkledonk (2021-06-28 02:23:53)

Offline

#2 2021-06-23 06:50:09

loqs
Member
Registered: 2014-03-06
Posts: 13,701

Re: [Solved] Compiling ki18n-git - "ImportError: No module named PyQt5.Qt"

Were you building ki18n-git from https://aur.archlinux.org/packages/ki18n-git/?  The AUR package built for me in a clean chroot using python3.
ki18n-git-5.84.0_r468.g0826840-1-x86_64-build.log

-- The C compiler identification is GNU 11.1.0
-- The CXX compiler identification is GNU 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 

-- Installing in the same prefix as Qt, adopting their path scheme.
-- Setting build type to 'Debug' as none was specified.
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - found
-- Performing Test _OFFT_IS_64BIT
-- Performing Test _OFFT_IS_64BIT - Success
-- Performing Test HAVE_DATE_TIME
-- Performing Test HAVE_DATE_TIME - Success
-- Looking for dngettext
-- Looking for dngettext - found
-- libintl is part of libc, no extra library is required.
-- Found LibIntl: /usr/include  
-- Performing Test HAVE_NL_MSG_CAT_CNTR
-- Performing Test HAVE_NL_MSG_CAT_CNTR - Success
-- Found PythonInterp: /usr/bin/python (found version "3.9.5") 
-- Found Gettext: /usr/bin/msgmerge (found version "0.21") 
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Installing in the same prefix as Python3, adopting their path scheme.
-- Found /usr/lib/libclang.so
-- Testing if /usr/bin/python3 can be used to run sip_generator
-- Self-check passed, Using /usr/bin/python3 to generate bindings
-- Found dependencies for python3, generating bindings
-- Python3 install dir: /usr/lib/python3.9/site-packages
-- Found Doxygen: /usr/bin/doxygen (found suitable version "1.9.1", minimum required is "1.8.13") found components: doxygen missing components: dot
-- Found QHelpGenerator executable: /usr/bin/qhelpgenerator
-- No such target Qt5Core_QCH defined when calling ecm_add_qch(), ignored.
-- The following features have been enabled:

 * QCH, API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)

-- The following OPTIONAL packages have been found:

 * PythonModuleGeneration

-- The following REQUIRED packages have been found:

 * ECM (required version >= 5.84.0), Extra CMake Modules., <https://commits.kde.org/extra-cmake-modules>
 * Qt5 (required version >= 5.15.0)
 * Qt5Network (required version >= 5.15.2)
 * Qt5Qml (required version >= 5.15.0)
 * LibIntl, <http://gnuwin32.sourceforge.net/packages/libintl.htm>
   Needed for building KI18n unless glibc is the system libc implementation
 * PythonInterp
 * Gettext
 * Doxygen (required version >= 1.8.13)
   Needed for API dox QCH file generation
 * QHelpGenerator, Part of Qt5 tools
   Needed for API dox QCH file generation
 * Qt5Core

-- Configuring done
-- Generating done
-- Build files have been written to: /build/ki18n-git/src/build
[  3%] Automatic MOC for target ktranscript
[  7%] Generating sip/PyKF5/KI18n/klocalizedcontext.sip
[ 18%] Automatic MOC for target KF5I18n
[ 18%] Generating sip/PyKF5/KI18n/klocalizedstring.sip
[ 18%] Generating src/KF5I18n.qch, src/KF5I18n.tags
[ 22%] Generating sip/PyKF5/KI18n/kuitsetup.sip
[ 25%] Generating sip/PyKF5/KI18n/klocalizedtranslator.sip
[ 29%] Generating sip/PyKF5/KI18n/kuitmarkup.sip
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-builduser'
[ 29%] Built target KF5I18n_autogen
[ 29%] Built target ktranscript_autogen
[ 33%] Building CXX object src/CMakeFiles/KF5I18n.dir/kcatalog.cpp.o
[ 37%] Building CXX object src/CMakeFiles/KF5I18n.dir/common_helpers.cpp.o
[ 40%] Building CXX object src/CMakeFiles/KF5I18n.dir/klocalizedstring.cpp.o
[ 51%] Building CXX object src/CMakeFiles/KF5I18n.dir/klocalizedtranslator.cpp.o
[ 51%] Building CXX object src/CMakeFiles/KF5I18n.dir/KF5I18n_autogen/mocs_compilation.cpp.o
[ 51%] Building CXX object src/CMakeFiles/KF5I18n.dir/klocalizedcontext.cpp.o
[ 55%] Building CXX object src/CMakeFiles/KF5I18n.dir/ki18n_logging_kuit.cpp.o
[ 59%] Building CXX object src/CMakeFiles/KF5I18n.dir/kuitmarkup.cpp.o
[ 62%] Building CXX object src/CMakeFiles/KF5I18n.dir/ki18n_logging.cpp.o
[ 66%] Building CXX object src/CMakeFiles/KF5I18n.dir/main.cpp.o
[ 74%] Building CXX object src/CMakeFiles/ktranscript.dir/ktranscript_autogen/mocs_compilation.cpp.o
[ 74%] Building CXX object src/CMakeFiles/ktranscript.dir/ktranscript.cpp.o
[ 77%] Building CXX object src/CMakeFiles/ktranscript.dir/common_helpers.cpp.o
Building up file structure...
Insert custom filters...
Insert help data for filter section (1 of 1)...
Insert files...
Insert contents...
Insert indices...
Documentation successfully generated.
[ 77%] Built target KF5I18n_QCH
[ 77%] Built target generate_KI18n_sip_files
[ 81%] Generating pybuild/PyKF5/KI18n/unifiedKI18n.cpp
In file included from /build/ki18n-git/src/ki18n/src/kcatalog.cpp:28:
/build/ki18n-git/src/ki18n/src/gettext.h: In function ‘const char* dpgettext_expr(const char*, const char*, const char*)’:
/build/ki18n-git/src/ki18n/src/gettext.h:103:10: warning: ISO C++ forbids variable length array ‘msg_ctxt_id’ [-Wvla]
  103 |     char msg_ctxt_id[msgctxt_len + msgid_len];
      |          ^~~~~~~~~~~
/build/ki18n-git/src/ki18n/src/gettext.h: In function ‘const char* dnpgettext_expr(const char*, const char*, const char*, const char*, long unsigned int)’:
/build/ki18n-git/src/ki18n/src/gettext.h:153:10: warning: ISO C++ forbids variable length array ‘msg_ctxt_id’ [-Wvla]
  153 |     char msg_ctxt_id[msgctxt_len + msgid_len];
      |          ^~~~~~~~~~~
b''
[ 81%] Built target sip_generated_KI18n_files
[ 85%] Linking CXX shared module ../bin/ktranscript.so
[ 85%] Built target ktranscript
[ 88%] Linking CXX shared library ../bin/libKF5I18n.so
[ 88%] Built target KF5I18n
[ 92%] Building CXX object src/CMakeFiles/Py3KF5KI18n.dir/pybuild/PyKF5/KI18n/unifiedKI18n.cpp.o
In file included from /build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/unifiedKI18n.cpp:1:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedContext.cpp: In function ‘PyObject* meth_KLocalizedContext_sender(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedContext.cpp:293:33: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  293 |              ::QObject*sipRes = 0;
      |                                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedContext.cpp:312:68: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  312 |             static qtcore_qobject_sender_t qtcore_qobject_sender = 0;
      |                                                                    ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedContext.cpp: In function ‘PyObject* meth_KLocalizedContext_receivers(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedContext.cpp:351:74: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  351 |         static pyqt5_get_signal_signature_t pyqt5_get_signal_signature = 0;
      |                                                                          ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedContext.cpp:378:24: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  378 |                 return 0;
      |                        ^
In file included from /build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/unifiedKI18n.cpp:2:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp: In function ‘PyObject* convertFrom_QSet_0100QString(void*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:128:29: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  128 |     PyObject *s = PySet_New(0);
      |                             ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:131:16: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  131 |         return 0;
      |                ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:147:20: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  147 |             return 0;
      |                    ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp: At global scope:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:163:9: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  163 |         0,
      |         ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:166:10: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  166 |         {0},
      |          ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:167:9: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  167 |         0
      |         ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:172:12: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  172 |         0, 0,
      |            ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:173:12: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  173 |         0, 0,
      |            ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:174:12: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  174 |         0, 0,
      |            ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:10: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |          ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:13: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |             ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:16: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:19: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                   ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:22: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                      ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:25: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                         ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:28: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                            ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:31: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                               ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:34: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                                  ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:37: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                                     ^
In file included from /build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/unifiedKI18n.cpp:4:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: In function ‘QString klocalizedstring_i18n_template(KLocalizedString, PyObject*, int*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:151:17: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  151 |           arg = 0;
      |                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: In function ‘PyObject* func_i18ncp(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:389:33: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  389 |              ::QString*sipRes = 0;
      |                                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:400:24: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  400 |                 return 0;
      |                        ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: In function ‘PyObject* func_i18np(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:425:33: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  425 |              ::QString*sipRes = 0;
      |                                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:436:24: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  436 |                 return 0;
      |                        ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: In function ‘PyObject* func_i18nc(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:461:33: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  461 |              ::QString*sipRes = 0;
      |                                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:472:24: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  472 |                 return 0;
      |                        ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: In function ‘PyObject* func_i18n(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:496:33: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  496 |              ::QString*sipRes = 0;
      |                                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:507:24: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  507 |                 return 0;
      |                        ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: At global scope:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1049:11: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1049 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__TagClass, {0}, 0}, sipNameNr_TagClass, 3, SIP_NULLPTR},
      |           ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1049:14: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1049 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__TagClass, {0}, 0}, sipNameNr_TagClass, 3, SIP_NULLPTR},
      |              ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1049:59: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1049 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__TagClass, {0}, 0}, sipNameNr_TagClass, 3, SIP_NULLPTR},
      |                                                           ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1049:63: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1049 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__TagClass, {0}, 0}, sipNameNr_TagClass, 3, SIP_NULLPTR},
      |                                                               ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1050:11: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1050 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__VisualFormat, {0}, 0}, sipNameNr_VisualFormat, 3, SIP_NULLPTR},
      |           ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1050:14: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1050 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__VisualFormat, {0}, 0}, sipNameNr_VisualFormat, 3, SIP_NULLPTR},
      |              ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1050:63: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1050 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__VisualFormat, {0}, 0}, sipNameNr_VisualFormat, 3, SIP_NULLPTR},
      |                                                               ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1050:67: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1050 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__VisualFormat, {0}, 0}, sipNameNr_VisualFormat, 3, SIP_NULLPTR},
      |                                                                   ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1104:5: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1104 |     0,
      |     ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1107:5: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1107 |     0,
      |     ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: In function ‘PyObject* PyInit_KI18n()’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1265:79: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1265 |     if (sipExportModule(&sipModuleAPI_KI18n,SIP_API_MAJOR_NR,SIP_API_MINOR_NR,0) < 0)
      |                                                                               ^
In file included from /build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/unifiedKI18n.cpp:7:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedTranslator.cpp: In function ‘PyObject* meth_KLocalizedTranslator_sender(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedTranslator.cpp:326:33: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  326 |              ::QObject*sipRes = 0;
      |                                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedTranslator.cpp:345:68: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  345 |             static qtcore_qobject_sender_t qtcore_qobject_sender = 0;
      |                                                                    ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedTranslator.cpp: In function ‘PyObject* meth_KLocalizedTranslator_receivers(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedTranslator.cpp:384:74: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  384 |         static pyqt5_get_signal_signature_t pyqt5_get_signal_signature = 0;
      |                                                                          ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedTranslator.cpp:411:24: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  411 |                 return 0;
      |                        ^
[ 96%] Linking CXX shared module ../py3/PyKF5/KI18n.so
[100%] Built target Py3KF5KI18n

Offline

#3 2021-06-23 08:07:11

ShnorpSinkledonk
Member
Registered: 2021-02-06
Posts: 19

Re: [Solved] Compiling ki18n-git - "ImportError: No module named PyQt5.Qt"

Yep, I am just running "yay -S ki18n-git". Another thing that is strange is that the newest version of ECM in the repos is 5.83.0, and with it the build would fail even earlier.

I had to download and install ECM 5.84.0 from here to get the build to where it gets to now.

What version of ECM do you have?

Offline

#4 2021-06-23 08:14:59

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 13,358

Re: [Solved] Compiling ki18n-git - "ImportError: No module named PyQt5.Qt"

Are sure you are going about this correctly? Which package do you actually want to have built at the end of this? As far as I understand your first post your end goal is neither cmake extra modules nor ki18n

Last edited by V1del (2021-06-23 08:15:49)

Offline

#5 2021-06-23 08:21:27

loqs
Member
Registered: 2014-03-06
Posts: 13,701

Re: [Solved] Compiling ki18n-git - "ImportError: No module named PyQt5.Qt"

ki18n-git depends on extra-cmake-modules-git,  I used 5.84.0.r3325.65c50eda-1.
If you install devtools and run the commands below does that work?

git clone https://aur.archlinux.org/extra-cmake-modules-git.git
cd extra-cmake-modules-git/
extra-x86_64-build
cd ..
git clone https://aur.archlinux.org/ki18n-git.git
cd ki18n-git/
extra-x86_64-build -- -I ../extra-cmake-modules-git/extra-cmake-modules-git-5.84.0.r3325.65c50eda-1-any.pkg.tar.zst

Offline

#6 2021-06-23 17:35:45

ShnorpSinkledonk
Member
Registered: 2021-02-06
Posts: 19

Re: [Solved] Compiling ki18n-git - "ImportError: No module named PyQt5.Qt"

Checking PKGBUILD
PKGBUILD (ki18n-git) W: Make dependency (qt5-declarative) already included as dependency
Checking ki18n-git-5.84.0_r468.g0826840-1-x86_64.pkg.tar.zst
ki18n-git W: Dependency python detected but optional (libraries ['usr/lib/libpython3.9.so.1.0'] needed in files ['usr/lib/python3.9/site-packages/PyKF5/KI18n.so'])
==> Running checkpkg
error: target not found: ki18n-git
==> WARNING: Skipped checkpkg due to missing repo packages

Offline

#7 2021-06-23 18:04:30

loqs
Member
Registered: 2014-03-06
Posts: 13,701

Re: [Solved] Compiling ki18n-git - "ImportError: No module named PyQt5.Qt"

Checking ki18n-git-5.84.0_r468.g0826840-1-x86_64.pkg.tar.zst

The package was built successfully.  As the package is not in the official repositories checkpkg could not find it.

Offline

#8 2021-06-23 20:37:47

ShnorpSinkledonk
Member
Registered: 2021-02-06
Posts: 19

Re: [Solved] Compiling ki18n-git - "ImportError: No module named PyQt5.Qt"

Interesting, so when building in the chroot the run-sip.py script doesn't seem to even run, as I've modified it to create a test file and it wasn't created. Then what could be stopping it from working outside of the chroot?

Offline

#9 2021-06-23 20:47:05

loqs
Member
Registered: 2014-03-06
Posts: 13,701

Re: [Solved] Compiling ki18n-git - "ImportError: No module named PyQt5.Qt"

I would compare the build logs see if you can determine where they diverge.  The snippet you posted is too short for me to tell anything from.  As you mentioned python2,  that would not be installed in the chroot.
Apart from packages excluded from the chroot it could also be different package versions or  environment options.

Does the package that required ki18n-git build and function now that you have built ki18n-git?

Offline

#10 2021-06-23 21:03:58

ShnorpSinkledonk
Member
Registered: 2021-02-06
Posts: 19

Re: [Solved] Compiling ki18n-git - "ImportError: No module named PyQt5.Qt"

The package that I am trying to build, plasma-workspace-git, has now gone further with the working ki18n-git but it now stops at building the package "kcoreaddons-git". It is throwing the exact same error. I can probably do the same thing as I did with ki18n-git, but there must be a root cause for both of these problems.

Build log for ki18n-git installed using yay:

==> Making package: ki18n-git 5.84.0_r468.g0826840-1 (Wed 23 Jun 2021 02:00:03 PM PDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
-- The C compiler identification is GNU 11.1.0
-- The CXX compiler identification is GNU 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 

-- Installing in the same prefix as Qt, adopting their path scheme.
-- Setting build type to 'Debug' as none was specified.
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - found
-- Performing Test _OFFT_IS_64BIT
-- Performing Test _OFFT_IS_64BIT - Success
-- Performing Test HAVE_DATE_TIME
-- Performing Test HAVE_DATE_TIME - Success
-- Looking for dngettext
-- Looking for dngettext - found
-- libintl is part of libc, no extra library is required.
-- Found LibIntl: /usr/include  
-- Performing Test HAVE_NL_MSG_CAT_CNTR
-- Performing Test HAVE_NL_MSG_CAT_CNTR - Success
-- Found PythonInterp: /usr/bin/python (found version "3.9.5") 
-- Found Gettext: /usr/bin/msgmerge (found version "0.21") 
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Installing in the same prefix as Python3, adopting their path scheme.
-- Installing in the same prefix as Python2, adopting their path scheme.
-- Found /usr/lib/libclang.so
-- Testing if /usr/bin/python2 can be used to run sip_generator
-- Self-check passed, Using /usr/bin/python2 to generate bindings
-- Found dependencies for python3, generating bindings
-- Python3 install dir: /usr/lib/python3.9/site-packages
-- Found dependencies for python2, generating bindings
-- Python2 install dir: /usr/lib/python2.7/site-packages
-- Found Doxygen: /usr/bin/doxygen (found suitable version "1.9.1", minimum required is "1.8.13") found components: doxygen dot 
-- Found QHelpGenerator executable: /usr/bin/qhelpgenerator
-- The following features have been enabled:

 * QCH, API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)

-- The following OPTIONAL packages have been found:

 * PythonModuleGeneration

-- The following REQUIRED packages have been found:

 * ECM (required version >= 5.84.0), Extra CMake Modules., <https://commits.kde.org/extra-cmake-modules>
 * Qt5 (required version >= 5.15.0)
 * Qt5Network (required version >= 5.15.2)
 * Qt5Qml (required version >= 5.15.0)
 * LibIntl, <http://gnuwin32.sourceforge.net/packages/libintl.htm>
   Needed for building KI18n unless glibc is the system libc implementation
 * PythonInterp
 * Gettext
 * Doxygen (required version >= 1.8.13)
   Needed for API dox QCH file generation
 * QHelpGenerator, Part of Qt5 tools
   Needed for API dox QCH file generation
 * Qt5Core

-- Configuring done
-- Generating done
-- Build files have been written to: /home/max/.cache/yay/ki18n-git/src/build
[  3%] Automatic MOC for target KF5I18n
[  3%] Built target KF5I18n_autogen
[  6%] Building CXX object src/CMakeFiles/KF5I18n.dir/KF5I18n_autogen/mocs_compilation.cpp.o
[ 10%] Building CXX object src/CMakeFiles/KF5I18n.dir/klocalizedstring.cpp.o
[ 13%] Building CXX object src/CMakeFiles/KF5I18n.dir/klocalizedtranslator.cpp.o
[ 16%] Building CXX object src/CMakeFiles/KF5I18n.dir/kcatalog.cpp.o
In file included from /home/max/.cache/yay/ki18n-git/src/ki18n/src/kcatalog.cpp:28:
/home/max/.cache/yay/ki18n-git/src/ki18n/src/gettext.h: In function ‘const char* dpgettext_expr(const char*, const char*, const char*)’:
/home/max/.cache/yay/ki18n-git/src/ki18n/src/gettext.h:103:10: warning: ISO C++ forbids variable length array ‘msg_ctxt_id’ [-Wvla]
  103 |     char msg_ctxt_id[msgctxt_len + msgid_len];
      |          ^~~~~~~~~~~
/home/max/.cache/yay/ki18n-git/src/ki18n/src/gettext.h: In function ‘const char* dnpgettext_expr(const char*, const char*, const char*, const char*, long unsigned int)’:
/home/max/.cache/yay/ki18n-git/src/ki18n/src/gettext.h:153:10: warning: ISO C++ forbids variable length array ‘msg_ctxt_id’ [-Wvla]
  153 |     char msg_ctxt_id[msgctxt_len + msgid_len];
      |          ^~~~~~~~~~~
[ 20%] Building CXX object src/CMakeFiles/KF5I18n.dir/kuitmarkup.cpp.o
[ 23%] Building CXX object src/CMakeFiles/KF5I18n.dir/common_helpers.cpp.o
[ 26%] Building CXX object src/CMakeFiles/KF5I18n.dir/klocalizedcontext.cpp.o
[ 30%] Building CXX object src/CMakeFiles/KF5I18n.dir/main.cpp.o
[ 33%] Building CXX object src/CMakeFiles/KF5I18n.dir/ki18n_logging.cpp.o
[ 36%] Building CXX object src/CMakeFiles/KF5I18n.dir/ki18n_logging_kuit.cpp.o
[ 40%] Linking CXX shared library ../bin/libKF5I18n.so
[ 40%] Built target KF5I18n
[ 43%] Generating sip/PyKF5/KI18n/klocalizedcontext.sip
[ 46%] Generating sip/PyKF5/KI18n/klocalizedstring.sip
[ 50%] Generating sip/PyKF5/KI18n/klocalizedtranslator.sip
[ 53%] Generating sip/PyKF5/KI18n/kuitmarkup.sip
[ 56%] Generating sip/PyKF5/KI18n/kuitsetup.sip
[ 56%] Built target generate_KI18n_sip_files
[ 60%] Generating pybuild/PyKF5/KI18n/unifiedKI18n.cpp
Traceback (most recent call last):
  File "/usr/share/ECM/find-modules/run-sip.py", line 10, in <module>
    from PyQt5.Qt import PYQT_CONFIGURATION
ImportError: No module named PyQt5.Qt
make[2]: *** [src/CMakeFiles/sip_generated_KI18n_files.dir/build.make:77: src/pybuild/PyKF5/KI18n/unifiedKI18n.cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:478: src/CMakeFiles/sip_generated_KI18n_files.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
error making: ki18n-git

Build log for compiling in chroot:

==> Updated version: ki18n-git 5.84.0_r468.g0826840-1
==> Starting build()...
-- The C compiler identification is GNU 11.1.0
-- The CXX compiler identification is GNU 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 

-- Installing in the same prefix as Qt, adopting their path scheme.
-- Setting build type to 'Debug' as none was specified.
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - found
-- Performing Test _OFFT_IS_64BIT
-- Performing Test _OFFT_IS_64BIT - Success
-- Performing Test HAVE_DATE_TIME
-- Performing Test HAVE_DATE_TIME - Success
-- Looking for dngettext
-- Looking for dngettext - found
-- libintl is part of libc, no extra library is required.
-- Found LibIntl: /usr/include  
-- Performing Test HAVE_NL_MSG_CAT_CNTR
-- Performing Test HAVE_NL_MSG_CAT_CNTR - Success
-- Found PythonInterp: /usr/bin/python (found version "3.9.5") 
-- Found Gettext: /usr/bin/msgmerge (found version "0.21") 
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Installing in the same prefix as Python3, adopting their path scheme.
-- Found /usr/lib/libclang.so
-- Testing if /usr/bin/python3 can be used to run sip_generator
-- Self-check passed, Using /usr/bin/python3 to generate bindings
-- Found dependencies for python3, generating bindings
-- Python3 install dir: /usr/lib/python3.9/site-packages
-- Found Doxygen: /usr/bin/doxygen (found suitable version "1.9.1", minimum required is "1.8.13") found components: doxygen missing components: dot
-- Found QHelpGenerator executable: /usr/bin/qhelpgenerator
-- No such target Qt5Core_QCH defined when calling ecm_add_qch(), ignored.
-- The following features have been enabled:

 * QCH, API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)

-- The following OPTIONAL packages have been found:

 * PythonModuleGeneration

-- The following REQUIRED packages have been found:

 * ECM (required version >= 5.84.0), Extra CMake Modules., <https://commits.kde.org/extra-cmake-modules>
 * Qt5 (required version >= 5.15.0)
 * Qt5Network (required version >= 5.15.2)
 * Qt5Qml (required version >= 5.15.0)
 * LibIntl, <http://gnuwin32.sourceforge.net/packages/libintl.htm>
   Needed for building KI18n unless glibc is the system libc implementation
 * PythonInterp
 * Gettext
 * Doxygen (required version >= 1.8.13)
   Needed for API dox QCH file generation
 * QHelpGenerator, Part of Qt5 tools
   Needed for API dox QCH file generation
 * Qt5Core

-- Configuring done
-- Generating done
-- Build files have been written to: /build/ki18n-git/src/build
[  3%] Generating src/KF5I18n.qch, src/KF5I18n.tags
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-builduser'
Building up file structure...
Insert custom filters...
Insert help data for filter section (1 of 1)...
Insert files...
Insert contents...
Insert indices...
Documentation successfully generated.
[  3%] Built target KF5I18n_QCH
[  7%] Automatic MOC for target ktranscript
[  7%] Built target ktranscript_autogen
[ 11%] Building CXX object src/CMakeFiles/ktranscript.dir/ktranscript_autogen/mocs_compilation.cpp.o
[ 14%] Building CXX object src/CMakeFiles/ktranscript.dir/ktranscript.cpp.o
[ 18%] Building CXX object src/CMakeFiles/ktranscript.dir/common_helpers.cpp.o
[ 22%] Linking CXX shared module ../bin/ktranscript.so
[ 22%] Built target ktranscript
[ 25%] Automatic MOC for target KF5I18n
[ 25%] Built target KF5I18n_autogen
[ 29%] Building CXX object src/CMakeFiles/KF5I18n.dir/KF5I18n_autogen/mocs_compilation.cpp.o
[ 33%] Building CXX object src/CMakeFiles/KF5I18n.dir/klocalizedstring.cpp.o
[ 37%] Building CXX object src/CMakeFiles/KF5I18n.dir/klocalizedtranslator.cpp.o
[ 40%] Building CXX object src/CMakeFiles/KF5I18n.dir/kcatalog.cpp.o
In file included from /build/ki18n-git/src/ki18n/src/kcatalog.cpp:28:
/build/ki18n-git/src/ki18n/src/gettext.h: In function ‘const char* dpgettext_expr(const char*, const char*, const char*)’:
/build/ki18n-git/src/ki18n/src/gettext.h:103:10: warning: ISO C++ forbids variable length array ‘msg_ctxt_id’ [-Wvla]
  103 |     char msg_ctxt_id[msgctxt_len + msgid_len];
      |          ^~~~~~~~~~~
/build/ki18n-git/src/ki18n/src/gettext.h: In function ‘const char* dnpgettext_expr(const char*, const char*, const char*, const char*, long unsigned int)’:
/build/ki18n-git/src/ki18n/src/gettext.h:153:10: warning: ISO C++ forbids variable length array ‘msg_ctxt_id’ [-Wvla]
  153 |     char msg_ctxt_id[msgctxt_len + msgid_len];
      |          ^~~~~~~~~~~
[ 44%] Building CXX object src/CMakeFiles/KF5I18n.dir/kuitmarkup.cpp.o
[ 48%] Building CXX object src/CMakeFiles/KF5I18n.dir/common_helpers.cpp.o
[ 51%] Building CXX object src/CMakeFiles/KF5I18n.dir/klocalizedcontext.cpp.o
[ 55%] Building CXX object src/CMakeFiles/KF5I18n.dir/main.cpp.o
[ 59%] Building CXX object src/CMakeFiles/KF5I18n.dir/ki18n_logging.cpp.o
[ 62%] Building CXX object src/CMakeFiles/KF5I18n.dir/ki18n_logging_kuit.cpp.o
[ 66%] Linking CXX shared library ../bin/libKF5I18n.so
[ 66%] Built target KF5I18n
[ 70%] Generating sip/PyKF5/KI18n/klocalizedcontext.sip
[ 74%] Generating sip/PyKF5/KI18n/klocalizedstring.sip
[ 77%] Generating sip/PyKF5/KI18n/klocalizedtranslator.sip
[ 81%] Generating sip/PyKF5/KI18n/kuitmarkup.sip
[ 85%] Generating sip/PyKF5/KI18n/kuitsetup.sip
[ 85%] Built target generate_KI18n_sip_files
[ 88%] Generating pybuild/PyKF5/KI18n/unifiedKI18n.cpp
b''
[ 88%] Built target sip_generated_KI18n_files
[ 92%] Building CXX object src/CMakeFiles/Py3KF5KI18n.dir/pybuild/PyKF5/KI18n/unifiedKI18n.cpp.o
In file included from /build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/unifiedKI18n.cpp:1:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp: In function ‘PyObject* convertFrom_QSet_0100QString(void*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:128:29: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  128 |     PyObject *s = PySet_New(0);
      |                             ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:131:16: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  131 |         return 0;
      |                ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:147:20: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  147 |             return 0;
      |                    ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp: At global scope:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:163:9: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  163 |         0,
      |         ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:166:10: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  166 |         {0},
      |          ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:167:9: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  167 |         0
      |         ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:172:12: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  172 |         0, 0,
      |            ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:173:12: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  173 |         0, 0,
      |            ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:174:12: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  174 |         0, 0,
      |            ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:10: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |          ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:13: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |             ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:16: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:19: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                   ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:22: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                      ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:25: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                         ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:28: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                            ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:31: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                               ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:34: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                                  ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nQSet0100QString.cpp:175:37: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  175 |         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
      |                                     ^
In file included from /build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/unifiedKI18n.cpp:3:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: In function ‘QString klocalizedstring_i18n_template(KLocalizedString, PyObject*, int*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:151:17: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  151 |           arg = 0;
      |                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: In function ‘PyObject* func_i18ncp(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:389:33: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  389 |              ::QString*sipRes = 0;
      |                                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:400:24: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  400 |                 return 0;
      |                        ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: In function ‘PyObject* func_i18np(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:425:33: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  425 |              ::QString*sipRes = 0;
      |                                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:436:24: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  436 |                 return 0;
      |                        ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: In function ‘PyObject* func_i18nc(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:461:33: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  461 |              ::QString*sipRes = 0;
      |                                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:472:24: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  472 |                 return 0;
      |                        ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: In function ‘PyObject* func_i18n(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:496:33: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  496 |              ::QString*sipRes = 0;
      |                                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:507:24: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  507 |                 return 0;
      |                        ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: At global scope:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1049:11: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1049 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__TagClass, {0}, 0}, sipNameNr_TagClass, 3, SIP_NULLPTR},
      |           ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1049:14: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1049 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__TagClass, {0}, 0}, sipNameNr_TagClass, 3, SIP_NULLPTR},
      |              ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1049:59: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1049 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__TagClass, {0}, 0}, sipNameNr_TagClass, 3, SIP_NULLPTR},
      |                                                           ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1049:63: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1049 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__TagClass, {0}, 0}, sipNameNr_TagClass, 3, SIP_NULLPTR},
      |                                                               ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1050:11: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1050 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__VisualFormat, {0}, 0}, sipNameNr_VisualFormat, 3, SIP_NULLPTR},
      |           ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1050:14: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1050 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__VisualFormat, {0}, 0}, sipNameNr_VisualFormat, 3, SIP_NULLPTR},
      |              ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1050:63: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1050 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__VisualFormat, {0}, 0}, sipNameNr_VisualFormat, 3, SIP_NULLPTR},
      |                                                               ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1050:67: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1050 |     {{-1, 0, 0, SIP_TYPE_ENUM, sipNameNr_Kuit__VisualFormat, {0}, 0}, sipNameNr_VisualFormat, 3, SIP_NULLPTR},
      |                                                                   ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1104:5: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1104 |     0,
      |     ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1107:5: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1107 |     0,
      |     ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp: In function ‘PyObject* PyInit_KI18n()’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18ncmodule.cpp:1265:79: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
 1265 |     if (sipExportModule(&sipModuleAPI_KI18n,SIP_API_MAJOR_NR,SIP_API_MINOR_NR,0) < 0)
      |                                                                               ^
In file included from /build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/unifiedKI18n.cpp:5:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedTranslator.cpp: In function ‘PyObject* meth_KLocalizedTranslator_sender(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedTranslator.cpp:326:33: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  326 |              ::QObject*sipRes = 0;
      |                                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedTranslator.cpp:345:68: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  345 |             static qtcore_qobject_sender_t qtcore_qobject_sender = 0;
      |                                                                    ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedTranslator.cpp: In function ‘PyObject* meth_KLocalizedTranslator_receivers(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedTranslator.cpp:384:74: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  384 |         static pyqt5_get_signal_signature_t pyqt5_get_signal_signature = 0;
      |                                                                          ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedTranslator.cpp:411:24: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  411 |                 return 0;
      |                        ^
In file included from /build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/unifiedKI18n.cpp:7:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedContext.cpp: In function ‘PyObject* meth_KLocalizedContext_sender(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedContext.cpp:293:33: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  293 |              ::QObject*sipRes = 0;
      |                                 ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedContext.cpp:312:68: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  312 |             static qtcore_qobject_sender_t qtcore_qobject_sender = 0;
      |                                                                    ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedContext.cpp: In function ‘PyObject* meth_KLocalizedContext_receivers(PyObject*, PyObject*)’:
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedContext.cpp:351:74: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  351 |         static pyqt5_get_signal_signature_t pyqt5_get_signal_signature = 0;
      |                                                                          ^
/build/ki18n-git/src/build/src/pybuild/PyKF5/KI18n/sipKI18nKLocalizedContext.cpp:378:24: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
  378 |                 return 0;
      |                        ^
[ 96%] Linking CXX shared module ../py3/PyKF5/KI18n.so
[100%] Built target Py3KF5KI18n
==> Entering fakeroot environment...

And then just yay stuff

Offline

#11 2021-06-23 21:15:57

loqs
Member
Registered: 2014-03-06
Posts: 13,701

Re: [Solved] Compiling ki18n-git - "ImportError: No module named PyQt5.Qt"

From the none chroot build

-- Testing if /usr/bin/python2 can be used to run sip_generator
-- Self-check passed, Using /usr/bin/python2 to generate bindings

vs from the chroot build

-- Testing if /usr/bin/python3 can be used to run sip_generator
-- Self-check passed, Using /usr/bin/python3 to generate bindings

You could try adding the option -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.9 although as it finds both versions I suspect this will not work.

Offline

#12 2021-06-23 21:29:08

ShnorpSinkledonk
Member
Registered: 2021-02-06
Posts: 19

Re: [Solved] Compiling ki18n-git - "ImportError: No module named PyQt5.Qt"

As you suspected, the flag did not change anything. Isn't it so bizarre that it's invoking python2 instead of python3?

Offline

#13 2021-06-23 22:00:23

ShnorpSinkledonk
Member
Registered: 2021-02-06
Posts: 19

Re: [Solved] Compiling ki18n-git - "ImportError: No module named PyQt5.Qt"

Alright, so I think I may have partially figured it out. The file "/usr/share/ECM/find-modules/FindPythonModuleGeneration.cmake", which does the sip_generator test, has the following code:

...
foreach (pyversion "2" "3")
  set(GPB_PYTHON_COMMAND ${GPB_PYTHON${pyversion}_COMMAND})
  if (NOT GPB_PYTHON_COMMAND)
    continue()
  endif()
  message(STATUS "Testing if ${GPB_PYTHON_COMMAND} can be used to run sip_generator")
...

From what I can tell, it first loops through with 'pyversion' set to 2 and if 'GPB_PYTHON_COMMAND' is null, it skips the rest and loops through again, checking the same thing for python3.

To test this, I deleted the symbolic link "/usr/bin/python2", and sure enough, it installs just fine.
So to recap, this means that the ECM script is checking for python2 and then python3, and just uses the first one that is available. Since the chroot does not have python2, it uses python3 instead and works. However, since I have python2 installed, that's what it uses and fails.

I think this is a developer error and should be changed to ignore python2 completely.

Offline

Board footer

Powered by FluxBB