qpython3h新建不了,找不到qprinter.h导致在Ubuntu 14.04中为Python3.4构建PyQt5的问题,然后出现pyuic5错误...

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)

解决方案

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值