简体   繁体   English

树莓派 4 上的 PyQt5

[英]PyQt5 on Raspberry Pi 4

I'm trying to install PyQt5 on my Raspberry Pi 4. I work in a virtual env with Python 3.7 installed using source env/bin/activate I've updated my pip version to 20.2.4.我正在尝试在我的 Raspberry Pi 4 上安装 PyQt5。我在使用source env/bin/activate安装了 Python 3.7 的虚拟环境中工作我已将我的 pip 版本更新为 20.2.4。 If I use the command: pip install pyqt5 , the installation takes too long, it continues displaying for hours:如果我使用命令: pip install pyqt5 ,安装时间太长,它会继续显示几个小时:

collecting pyqt5 Using cached PyQt5-5.15.1.tar.gz (3.3 MB) installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata .../收集 pyqt5 使用缓存的 PyQt5-5.15.1.tar.gz (3.3 MB) 安装构建依赖项...完成获得构建轮子的要求...完成准备轮子元数据.../

I've tried to write sudo apt-get install pyqt5 but I found out that the package is installed for Python 2.7 version which was installed as default version on my Raspberry.我尝试编写sudo apt-get install pyqt5但我发现该软件包是为 Python 2.7 版本安装的,该版本在我的 Raspberry 上作为默认版本安装。

How can I install PyQt5 correctly?如何正确安装 PyQt5? I want to use it in Python3.7.我想在 Python3.7 中使用它。 I previosly installed pyqtgraph with the command pip and I did not get errors.我以前使用命令pip安装了 pyqtgraph,但没有出现错误。

You can use this command sudo apt-get install python3-pyqt5 .您可以使用此命令sudo apt-get install python3-pyqt5 There is only one question that the pyqt5 by that command doesn't work in the venv of PyCharm.只有一个问题是该命令的 pyqt5 在 PyCharm 的 venv 中不起作用。

Fine I found that if the selected python interpreter is system interpreter, it also worked in PyCharm.很好,我发现如果选择的 python 解释器是系统解释器,它也可以在 PyCharm 中工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM