问题一:AttributeError: module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel’
大意是缺少依赖,可以依次使用以下方法:
方法一:升级pip
但是对我而言升级pip没有用
pip3 install --upgrade pip3
方法二:安装QT5
sudo apt install qt5-default
然后再
pip3 install PyQt5
正如这个链接回答的评论里提到的:
This should be the selected answer, if QT5 is not installed on the host or there is a large enough version gap the metadata just won't exist or be valid.
PyQt5没有相应的依赖,而安装QT5之后就会有对应的metadata或者说依赖生成,之后就可以安装PyQt5了。
问题二:pip3 install PyQt5的时候卡在了Preparing Wheel metadata...
StackOverflow问题链接:
我也卡了很久,但是这个时候只要等待就好了,比如你可以
pip3 install --verbose PyQt5
可以在install的时候输出记录,查看是否卡在了后台。
问题三:pip3 install pyqt5-tools时候AttributeError: module ‘sipbuild.api’ has no attribute ‘prepare_metadata_for_build_wheel’
这个问题很好解决,不要在Xavier上安装pyqt-tools。至少我是用不到tools的,直接安装PyQt5。