树莓派无法安装PyQt5

4

我正在尝试在我的Raspberry Pi设备上安装PyQt5。

我已经尝试过:

pip3 install pyqt5

pip3 install --upgrade pip
pip3 install pyqt5==5.14.0

sudo apt-get update 
sudo apt-get install python3-pyqt5

它们都给了我错误:

  Using cached PyQt5-5.14.0.tar.gz (3.2 MB)
ERROR: pyqt5==5.14 from https://files.pythonhosted.org/packages/7c/5b/e760ec4f868cb77cee45b4554bf15d3fe6972176e89c4e3faac941213694/PyQt5-5.14.0.tar.gz#sha256=0145a6b7de15756366decb736c349a0cb510d706c83fda5b8cd9e0557bc1da72 has a pyproject.toml file that does not comply with PEP 518: 'build-system.requires' contains an invalid requirement: 'sip >=5.0.1 <6'

这里似乎有一个解决方案:https://stackoverflow.com/questions/59558343/cant-install-pyqt5-on-raspberry-pi - Rivers
2个回答

5

请尝试:

sudo apt install python3-pyqt5

3

您正在尝试安装PyQt5==5.14.0

https://pypi.org/project/PyQt5/5.14.0/#files

PyQt5-5.14.0.tar.gz\PyQt5-5.14.0.tar\PyQt5-5.14.0\pyproject.toml

# Specify the build system requirements.
[build-system]
requires = ["sip >=5.0.1 <6", "PyQt-builder >=1.1.0, <2"]
build-backend = "sipbuild.api"

# Specify the PEP 566 metadata for the project.
[tool.sip.metadata]
name = "PyQt5"
version = "5.14.0"
summary = "Python bindings for the Qt cross platform application toolkit"
home-page = "https://www.riverbankcomputing.com/software/pyqt/"
author = "Riverbank Computing Limited"
author-email = "info@riverbankcomputing.com"
license = "GPL v3"
description-file = "README"

sip >=5.0.1 <6 不是有效的PEP518格式。正确的格式应该是 sip >=5.0.1, <6

PyQt5==5.14.1中已经修复了这个错误。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接