Skip to content
Advertisement

error install PyQt5 on Yocto Linux – board Variscite

I have a problem installing a PyQt5 python package. I am in Yocto Linux environment (Hardknott kernel 5.10.35) on the Variscite board (DART-MX8M-PLUS). This is the log when I try to install with 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:~# 

Instead, this is the list of currently installed python packages:

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:~# 

How can it be solved? Thanks in advance!

Advertisement

Answer

Do not bother installing packages natively on the board,

PyQt5 is already supported by Yocto in meta-qt5, link to recipe.

Just add meta-qt5 to your bblayers.conf and :

IMAGE_INSTALL_append = " python3-pyqt5"
Advertisement