我刚刚在rapsberry pi上编译了Qt5.2.1 . 我无法找到有关Raspbian wheezy的SIP / PyQt5交叉编译的任何信息 .
我试图在Raspberry上编译sip / PyQt5 .
在Raspberry pi上
- Sip / Qt5
Sip构建正常,但因为我的内核映像的Qt5.2.1目录中没有Qmake,之前在我的PC上进行了交叉编译 . 所以PyQt5安装失败了 .
注意:由于Raspbian python3-sip模块不是PyQt5的正确版本(最小sip 4.15.5),你需要在Raspbian上编译最后的源代码版本
So now the question is :如何在我的Pc上交叉编译PyQt5?没有找到关于此的文档 .
PC上
- PyQt5
在我的PC上Qt5.2.1之后,PyQt5安装运行完美 . 但是当TI试图导入PyQt5模块时,我遇到了以下错误
$ from PyQt5 import QtCore
ImportError: libQt5Core.so.5: cannot open shared object file: No such file or directory
在我的电脑上,这个lib位于/opt/Qt5.2.1/5.2.1/gcc_64/lib/libQt5Core.so.5我将/opt/Qt5.2.1/5.2.1/gcc_64/lib/添加到$ LD_LIBRARY_PATH中现在的消息是:
$ from PyQt5 import QtCore
RuntimeError: the sip module implements API v11.0 but the PyQt5.QtCore module requires API v10.1
快速搜索后,SIP 4.15.5符合API级别11,SIP-4.15.4符合API级别10 . 所以尝试安装SIP 4.15.4 .
它工作,我可以导入PyQt5.QtCoe QtGui,QtNetwork ....
但我仍然坚持缺乏PyQt5交叉编译程序 .
任何的想法 ?
1 回答
幸运的是,现在可以从预编译的Debian存储库中获得所有必需的依赖项 .
假设你安装了 latest version of Raspbian (Kernel 4.14) , run the following commands in a terminal window:
最后一次安装修复了我在Pi 3上遇到的错误 . 在您的情况下可能没有必要(但肯定不会造成伤害 . )