PyQt5 installation

Hello,

I’m trying to install PyQt5 in a qt5-wayland-examples-vivante container. I have tried different methods, but they crash out in the following way:

root@61256fdbca98:/home/torizon# pip install pyqt5
Collecting pyqt5
  Using cached PyQt5-5.15.4.tar.gz (3.3 MB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-nwq_c6xh/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'sip >=5.3, <7' 'PyQt-builder >=1.9, <2'
       cwd: None
  Complete output (133 lines):
  Collecting sip<7,>=5.3
    Using cached sip-6.0.3.tar.gz (1.2 MB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
      Preparing wheel metadata: started
      Preparing wheel metadata: finished with status 'done'
  Collecting PyQt-builder<2,>=1.9
    Using cached PyQt_builder-1.9.1-py3-none-any.whl (5.6 MB)
  Collecting packaging
    Using cached packaging-20.9-py2.py3-none-any.whl (40 kB)
  Collecting toml
    Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
  Collecting pyparsing>=2.0.2
    Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
  Building wheels for collected packages: sip
    Building wheel for sip (PEP 517): started
    Building wheel for sip (PEP 517): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 /tmp/tmpirymt10p build_wheel /tmp/tmpow703lt5
         cwd: /tmp/pip-install-ni3ftjgz/sip
    Complete output (106 lines):
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-aarch64-3.8
    creating build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/argument_parser.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/project.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/abstract_builder.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/helpers.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/exceptions.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/bindings.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/abstract_project.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/api.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/buildable.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/builder.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/__init__.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/configurable.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/pyproject.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/version.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/installable.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/py_versions.py -> build/lib.linux-aarch64-3.8/sipbuild
    copying sipbuild/distutils_builder.py -> build/lib.linux-aarch64-3.8/sipbuild
    creating build/lib.linux-aarch64-3.8/sipbuild/distinfo
    copying sipbuild/distinfo/main.py -> build/lib.linux-aarch64-3.8/sipbuild/distinfo
    copying sipbuild/distinfo/distinfo.py -> build/lib.linux-aarch64-3.8/sipbuild/distinfo
    copying sipbuild/distinfo/__init__.py -> build/lib.linux-aarch64-3.8/sipbuild/distinfo
    creating build/lib.linux-aarch64-3.8/sipbuild/module
    copying sipbuild/module/main.py -> build/lib.linux-aarch64-3.8/sipbuild/module
    copying sipbuild/module/module.py -> build/lib.linux-aarch64-3.8/sipbuild/module
    copying sipbuild/module/abi_version.py -> build/lib.linux-aarch64-3.8/sipbuild/module
    copying sipbuild/module/__init__.py -> build/lib.linux-aarch64-3.8/sipbuild/module
    creating build/lib.linux-aarch64-3.8/sipbuild/tools
    copying sipbuild/tools/wheel.py -> build/lib.linux-aarch64-3.8/sipbuild/tools
    copying sipbuild/tools/install.py -> build/lib.linux-aarch64-3.8/sipbuild/tools
    copying sipbuild/tools/sdist.py -> build/lib.linux-aarch64-3.8/sipbuild/tools
    copying sipbuild/tools/__init__.py -> build/lib.linux-aarch64-3.8/sipbuild/tools
    copying sipbuild/tools/build.py -> build/lib.linux-aarch64-3.8/sipbuild/tools
    creating build/lib.linux-aarch64-3.8/sipbuild/module/source
    creating build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/sipint.h -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/setup.py.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/threads.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/bool.cpp -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/qtlib.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/descriptors.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/sip.rst.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/setup.cfg.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/array.h -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/siplib.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/apiversions.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/README.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/MANIFEST.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/pyproject.toml -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/sip.h.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/int_convertors.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/array.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/objmap.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/sip.pyi -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    copying sipbuild/module/source/12.7/voidptr.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.7
    creating build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/sipint.h -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/setup.py.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/threads.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/bool.cpp -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/qtlib.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/descriptors.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/sip.rst.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/setup.cfg.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/array.h -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/siplib.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/apiversions.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/README.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/MANIFEST.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/pyproject.toml -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/sip.h.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/int_convertors.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/array.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/objmap.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/sip.pyi -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    copying sipbuild/module/source/12.8/voidptr.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/12.8
    creating build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/sipint.h -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/setup.py.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/threads.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/bool.cpp -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/descriptors.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/sip.rst.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/setup.cfg.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/array.h -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/siplib.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/README.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/MANIFEST.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/pyproject.toml -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/sip.h.in -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/int_convertors.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/array.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/objmap.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/sip.pyi -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    copying sipbuild/module/source/13.0/voidptr.c -> build/lib.linux-aarch64-3.8/sipbuild/module/source/13.0
    running build_ext
    building 'sipbuild.code_generator' extension
    creating build/temp.linux-aarch64-3.8
    creating build/temp.linux-aarch64-3.8/code_generator
    aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Icode_generator -I/usr/include/python3.8 -c code_generator/export.c -o build/temp.linux-aarch64-3.8/code_generator/export.o
    error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
    ERROR: Failed building wheel for sip
  Failed to build sip
  ERROR: Could not build wheels for sip which use PEP 517 and cannot be installed directly
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/lib/python3/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-nwq_c6xh/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'sip >=5.3, <7' 'PyQt-builder >=1.9, <2' Check the logs for full command output.
root@61256fdbca98:/home/torizon# 

I would appreciate any kind of help on this one, I do not know where to begin…

Regards,
P.S.

In general if you need to install packages that have native code inside them it’s better to use debian packages, rather than pip. In this way you’ll get pre-build binaries without having to install the toolchain inside your container.
Our vscode extension supports Qt for Python (pyside2) and not PyQt, but this is a sample of the dockerfiles it generates:

FROM --platform=linux/arm64 torizon/qt5-wayland:2

# Make sure we don't get notifications we can't answer during building.
ENV DEBIAN_FRONTEND="noninteractive"

# Install required packages
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
    python3-minimal \
    python3-pip \
    python3-setuptools \
    qml-module-qtquick-controls \
    qml-module-qtquick-controls2 \
    qml-module-qtquick2 \
    python3-pyside2.qtwidgets \
    python3-pyside2.qtgui \
    python3-pyside2.qtqml \
    python3-pyside2.qtcore \
    python3-pyside2.qtquick \
    python3-pyside2.qtnetwork \
    qml-module-qtquick-dialogs \
    \
    && rm -rf /var/lib/apt/lists/*

USER torizon
WORKDIR /dummy010

CMD /usr/bin/python3 main.py 

Here https://packages.debian.org/search?suite=bullseye&section=all&arch=any&searchon=names&keywords=pyqt5
you can find packages for PyQt5, you can install them in a similar way.
If you are just starting development I would suggest checking pyside2 since this is what we are going to support in our development tools.