在 Yocto Linux 上安装 PyQt5 时出错 - 开发板 Variscite

error install PyQt5 on Yocto Linux - board Variscite

我在安装 PyQt5 python 包时遇到问题。我在 Yocto Linux 环境(Hardknott 内核 5.10.35)中 Variscite 开发板 (DART-MX8M-PLUS)。这是我尝试使用 pip 安装时的日志:

root@imx8mp-var-dart:~# pip install pyqt5
Collecting pyqt5
  Using cached PyQt5-5.15.6.tar.gz (3.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [29 lines of output]
      Traceback (most recent call last):
        File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, in prepare_metadata_for_build_wheel
          hook = backend.prepare_metadata_for_build_wheel
      AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 160, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
        File "/tmp/pip-build-env-j1_dul47/overlay/lib/python3.9/site-packages/sipbuild/api.py", line 51, in build_wheel
          project = AbstractProject.bootstrap('pep517')
        File "/tmp/pip-build-env-j1_dul47/overlay/lib/python3.9/site-packages/sipbuild/abstract_project.py", line 83, in bootstrap
          project.setup(pyproject, tool, tool_description)
        File "/tmp/pip-build-env-j1_dul47/overlay/lib/python3.9/site-packages/sipbuild/project.py", line 594, in setup
          self.apply_user_defaults(tool)
        File "/tmp/pip-install-w8dpcxmz/pyqt5_db6cfa3b68b641d3a6209736257b28c5/project.py", line 63, in apply_user_defaults
          super().apply_user_defaults(tool)
        File "/tmp/pip-build-env-j1_dul47/overlay/lib/python3.9/site-packages/pyqtbuild/project.py", line 70, in apply_user_defaults
          super().apply_user_defaults(tool)
        File "/tmp/pip-build-env-j1_dul47/overlay/lib/python3.9/site-packages/sipbuild/project.py", line 241, in apply_user_defaults
          self.builder.apply_user_defaults(tool)
        File "/tmp/pip-build-env-j1_dul47/overlay/lib/python3.9/site-packages/pyqtbuild/builder.py", line 67, in apply_user_defaults
          raise PyProjectOptionException('qmake',
      sipbuild.pyproject.PyProjectOptionException
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
root@imx8mp-var-dart:~# 

相反,这是当前安装的 python 个软件包的列表:

root@imx8mp-var-dart:~# pip list
Package           Version
----------------- --------------
attrs             20.3.0
btrfsutil         5.10.1
cycler            0.11.0
decorator         5.0.7
deepview-rt       2.4.25
fonttools         4.29.1
future            0.18.2
gpg               1.15.1-unknown
iniparse          0.4
kiwisolver        1.3.2
libcomps          0.1.15
matplotlib        3.5.1
mne               0.24.1
numpy             1.20.1
packaging         21.3
Pillow            8.2.0
pip               22.0.3
psutil            5.8.0
pyarmnn           24.0.0
pycairo           1.20.0
PyGObject         3.38.0
pyparsing         3.0.7
python-dateutil   2.8.2
scipy             1.8.0
setuptools        60.9.3
six               1.15.0
tflite-runtime    2.4.1
toml              0.10.2
torch             1.7.1
torchvision       0.8.2
tvm               0.7.0
typing-extensions 3.7.4.3
root@imx8mp-var-dart:~# 

如何解决?提前致谢!

不要费心在板上安装包,

PyQt5 已在 meta-qt5link 中得到 Yocto 的支持。

只需将 meta-qt5 添加到您的 bblayers.conf 和 :

IMAGE_INSTALL_append = " python3-pyqt5"