找不到qprinter.h导致在Ubuntu 14.04中为Python3.4构建PyQt5的问题,然后出现pyuic5错误 [英] Issues building PyQt5 for Python3.4 in Ubuntu 14.04 caused by qprinter.h not found then pyuic5 error

查看:228
本文介绍了找不到qprinter.h导致在Ubuntu 14.04中为Python3.4构建PyQt5的问题,然后出现pyuic5错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在安装了最新的SIP和最新的Qt5之后,我尝试为python 3.4构建最新的PyQt5。

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

我启动了pyqt5配置,如下所示:

I launched pyqt5 configure like this:

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

然后进行make和sudo make install。
在sudo make install期间出现此错误:

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

我可以导入QtCore,QtGui等,但不是QtWebKitWidgetsQWebView之后的按字母顺序排列的模块,例如QtWidgets ...

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

编辑:
第一个补丁

First patch

$ sudo apt-get install qtbase5-dev

然后在make和sudo make install之后出现此错误:

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)


推荐答案

qprinter.h 在Qt 5.3的QtPrintSupport模块中,但include目录不在编译器命令中。修改 configure.py

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']),

而不是

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

解决了构建失败。

这篇关于找不到qprinter.h导致在Ubuntu 14.04中为Python3.4构建PyQt5的问题,然后出现pyuic5错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆