Issues building PyQt5 for Python3.4 in Ubuntu 14.04 caused by qprinter.h not found then pyuic5 error

江枫思渺然 提交于 2019-12-11 07:05:45

问题


After installing the latest SIP, and the latest Qt5, I tried to build the latest PyQt5 for python 3.4.

I launched pyqt5 configure like this:

python3 configure.py --qmake=/opt/Qt/5.3/gcc_64/bin/qmake

Then make and sudo make install. During sudo make install I obtain this error:

cd QtWebKitWidgets/ && ( test -e Makefile || /opt/Qt/5.3/gcc_64/bin/qmake /home/me/Downloads/PyQt-gpl-5.3.2/QtWebKitWidgets/QtWebKitWidgets.pro -o Makefile ) && make -f Makefile install
make[1]: Entering directory `/home/me/Downloads/PyQt-gpl-5.3.2/QtWebKitWidgets'
g++ -c -pipe -fno-exceptions -O2 -Wall -W -D_REENTRANT -fPIC -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public -DQT_NO_DEBUG -DQT_PLUGIN -DQT_WEBKITWIDGETS_LIB -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/Qt/5.3/gcc_64/mkspecs/linux-g++ -I. -I. -I/usr/include/python3.4m -I/opt/Qt/5.3/gcc_64/include -I/opt/Qt/5.3/gcc_64/include/QtWebKitWidgets -I/opt/Qt/5.3/gcc_64/include/QtWebKit -I/opt/Qt/5.3/gcc_64/include/QtWidgets -I/opt/Qt/5.3/gcc_64/include/QtNetwork -I/opt/Qt/5.3/gcc_64/include/QtGui -I/opt/Qt/5.3/gcc_64/include/QtCore -I. -o sipQtWebKitWidgetsQWebView.o sipQtWebKitWidgetsQWebView.cpp
sip/QtPrintSupport/qprinter.sip:28:22: fatal error: qprinter.h: No such file or directory
compilation terminated.
make[1]: *** [sipQtWebKitWidgetsQWebView.o] Error 1
make[1]: Leaving directory `/home/me/Downloads/PyQt-gpl-5.3.2/QtWebKitWidgets'
make: *** [sub-QtWebKitWidgets-install_subtargets-ordered] Error 2

I can import QtCore, QtGui, etc. but not modules alphabetically after QtWebKitWidgetsQWebView like QtWidgets...

EDIT: First patch

$ sudo apt-get install qtbase5-dev

Then after make and sudo make install I get this error:

install -m 755 -p /home/me/Downloads/PyQt-gpl-5.3.2/pyuic5 /usr/bin/
strip /usr/bin/pyuic5
strip:/usr/bin/pyuic5: File format not recognized
make: [install_pyuic5] Error 1 (ignored)

回答1:


qprinter.h is in the QtPrintSupport module in Qt 5.3 but that include directory is not in the compiler command. Modifying configure.py such that

'QtWebKitWidgets':    ModuleMetadata(qmake_QT=['webkitwidgets', 'printsupport']),

instead of

'QtWebKitWidgets':    ModuleMetadata(qmake_QT=['webkitwidgets']),

resolves the build failure.



来源:https://stackoverflow.com/questions/26560673/issues-building-pyqt5-for-python3-4-in-ubuntu-14-04-caused-by-qprinter-h-not-fou

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!