无法在树莓派上使用pip安装PyQt5

时间:2019-12-23 22:43:31

标签: python pip raspberry-pi pyqt5 raspbian

在使用raspbian buuster的raspberry pi上,我是否尝试使用PyQt5安装

pip install PyQt5
pip3 install PyQt5
sudo -H pip install PyQt5
python3 -m pip install PyQt5
python3 -m pip install PyQt5 --user

所有这些命令都会产生

ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/local/lib/python3.7/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-rsse8fpi/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple -- 'sip >=5.0.1 <6' 'PyQt-builder >=1.1.0, <2'
       cwd: None
  Complete output (1 lines):
  ERROR: Invalid requirement: 'sip >=5.0.1 <6'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.7/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-rsse8fpi/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple -- 'sip >=5.0.1 <6' 'PyQt-builder >=1.1.0, <2' Check the logs for full command output.

可以安装其他库,它只是PyQt5。是什么让我无法仅安装PyQt5,如何解决?

2 个答案:

答案 0 :(得分:0)

根据我的经验安装pyqt5有点(有毒) 而且您在安装时需要非常小心 您用于python的IDE是什么? 如果是Pycharm,则(删除并重新安装),但请确保您添加了Python PATH enter image description here

重新安装(重新启动PC)后,然后按cmd -pip安装pyqt5

答案 1 :(得分:0)

这是pyproject.toml中的错误:更改

requires = ["sip >=5.0.1 <6", "PyQt-builder >=1.1.0, <2"]

requires = ["sip >=5.0.1, <6", "PyQt-builder >=1.1.0, <2"]

然后编译。