【问题标题】:Can't install PyQt5 using pip on raspberry pi无法在树莓派上使用 pip 安装 PyQt5
【发布时间】:2020-04-15 03:17:59
【问题描述】:

在使用 raspbian buuster 的树莓派上,我是否尝试使用安装 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,如何解决?

【问题讨论】:

  • 你可以通过apt安装:包sudo apt install python3-pyqt5
  • 谢谢!这解决了问题
  • sip &gt;=5.0.1 &lt;6 中缺少逗号,必须是sip &gt;=5.0.1, &lt;6
  • 不幸的是,这并不能解决问题,因为任何其他依赖于 pyqt5 的 pip3 包也将无法安装。

标签: python pip raspberry-pi pyqt5 raspbian


【解决方案1】:

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

在你重新安装后(重启你的电脑)然后 cmd -pip 安装 pyqt5

【讨论】:

  • 原来的问题是指 Raspbian Buster,所以它是关于基于 Linux 的系统。
  • 答案可能对某人有用,但与问题无关。
猜你喜欢
  • 1970-01-01
  • 2016-12-11
  • 1970-01-01
  • 1970-01-01
  • 2020-10-29
  • 1970-01-01
  • 2022-01-24
  • 2020-06-18
  • 1970-01-01
相关资源
最近更新 更多