Error installing pyqt5 under aarch64 architecture

Question:

I’m trying to install pyqt5 V5.15.2 on an emulate qemu aarch64 debian distro, but it fails with the following trace:

root@debian-arm64:~# pip install pyqt5==5.15.2 --config-settings --confirm-license= --verbose
Using pip 23.0.1 from /usr/local/lib/python3.9/dist-packages/pip (python 3.9)
Collecting pyqt5==5.15.2
  Using cached PyQt5-5.15.2.tar.gz (3.3 MB)
  Running command pip subprocess to install build dependencies
  Collecting sip<7,>=5.3
    Using cached sip-6.7.7-cp37-abi3-linux_aarch64.whl
  Collecting PyQt-builder<2,>=1.6
    Using cached PyQt_builder-1.14.1-py3-none-any.whl (3.7 MB)
  Collecting toml
    Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
  Collecting packaging
    Using cached packaging-23.0-py3-none-any.whl (42 kB)
  Collecting ply
    Using cached ply-3.11-py2.py3-none-any.whl (49 kB)
  Collecting setuptools
    Using cached setuptools-67.5.1-py3-none-any.whl (1.1 MB)
  Installing collected packages: ply, toml, setuptools, packaging, sip, PyQt-builder
  Successfully installed PyQt-builder-1.14.1 packaging-23.0 ply-3.11 setuptools-67.5.1 sip-6.7.7 toml-0.10.2
  WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  Getting requirements to build wheel ... done
  Running command Preparing metadata (pyproject.toml)
  Querying qmake about your Qt installation...
  This is the GPL version of PyQt 5.15.2 (licensed under the GNU General Public License) for Python 3.9.2 on linux.
  Found the license file 'pyqt-gpl.sip'.
  Checking to see if the QtCore bindings can be built...
  Checking to see if the QtNetwork bindings can be built...
  Checking to see if the QtGui bindings can be built...
  Checking to see if the QtWidgets bindings can be built...
  Checking to see if the QtQml bindings can be built...
  Checking to see if the QAxContainer bindings can be built...
  Checking to see if the QtAndroidExtras bindings can be built...
  Checking to see if the QtBluetooth bindings can be built...
  Checking to see if the QtDBus bindings can be built...
  Checking to see if the QtDesigner bindings can be built...
  Checking to see if the Enginio bindings can be built...
  Checking to see if the QtHelp bindings can be built...
  Checking to see if the QtMacExtras bindings can be built...
  Checking to see if the QtMultimedia bindings can be built...
  Checking to see if the QtMultimediaWidgets bindings can be built...
  Checking to see if the QtNetworkAuth bindings can be built...
  Checking to see if the QtNfc bindings can be built...
  Checking to see if the QtOpenGL bindings can be built...
  Checking to see if the QtPositioning bindings can be built...
  Checking to see if the QtLocation bindings can be built...
  Checking to see if the QtPrintSupport bindings can be built...
  Checking to see if the QtQuick bindings can be built...
  Checking to see if the QtQuick3D bindings can be built...
  Checking to see if the QtQuickWidgets bindings can be built...
  Checking to see if the QtRemoteObjects bindings can be built...
  Checking to see if the QtSensors bindings can be built...
  Checking to see if the QtSerialPort bindings can be built...
  Checking to see if the QtSql bindings can be built...
  Checking to see if the QtSvg bindings can be built...
  Checking to see if the QtTest bindings can be built...
  Checking to see if the QtTextToSpeech bindings can be built...
  Checking to see if the QtWebChannel bindings can be built...
  Checking to see if the QtWebKit bindings can be built...
  Checking to see if the QtWebKitWidgets bindings can be built...
  Checking to see if the QtWebSockets bindings can be built...
  Checking to see if the QtWinExtras bindings can be built...
  Checking to see if the QtX11Extras bindings can be built...
  Checking to see if the QtXml bindings can be built...
  Checking to see if the QtXmlPatterns bindings can be built...
  Checking to see if the _QOpenGLFunctions_2_0 bindings can be built...
  Checking to see if the _QOpenGLFunctions_2_1 bindings can be built...
  Checking to see if the _QOpenGLFunctions_4_1_Core bindings can be built...
  Checking to see if the dbus-python support should be built...
  The dbus-python package does not seem to be installed.
  These bindings will be built: Qt, QtCore, QtNetwork, QtGui, QtWidgets, QtDBus, QtOpenGL, QtPrintSupport, QtSql, QtTest, QtXml, _QOpenGLFunctions_2_0, _QOpenGLFunctions_2_1, _QOpenGLFunctions_4_1_Core, pylupdate, pyrcc.
  Generating the Qt bindings...
  _in_process.py: /tmp/pip-install-m6oiyjbv/pyqt5_1965ddd1193045bab17bb1f59ff08aa1/sip/QtCore/qprocess.sip: line 99: column 5: 'Q_PID' is undefined
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/bin/python3 /usr/local/lib/python3.9/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpo3qo2dlh
  cwd: /tmp/pip-install-m6oiyjbv/pyqt5_1965ddd1193045bab17bb1f59ff08aa1
  Preparing metadata (pyproject.toml) ... error
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.

The only 2 stuff I’m getting warn about are:

  • Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
  • The dbus-python package does not seem to be installed.

Speaking about the first one, every package installation is printing it: I don’t care, that’s just an emulated test environment.
Speaking about the second one, I’ve installed libdbus-1-3 and libdbus-1-dev and ran both pip install dbus-python (which seems to be a deprecated module) and dbus-next, so i don’t know what still missing there.

ISSUE
Apparently a Q_PID var in qprocess.sip seems to be undefined

_in_process.py: /tmp/pip-install-m6oiyjbv/pyqt5_1965ddd1193045bab17bb1f59ff08aa1/sip/QtCore/qprocess.sip: line 99: column 5: ‘Q_PID’ is undefined

QUESTION
What am I doing wrong? How should I fix this error?

EXTRA INFOS
List of installed packages:

root@debian-arm64:~# pip list
Package                   Version
------------------------- --------------
altgraph                  0.17.3
certifi                   2020.6.20
chardet                   4.0.0
dbus-next                 0.2.3
dbus-python               1.3.2
httplib2                  0.18.1
idna                      2.10
Mako                      1.1.3
Markdown                  3.3.4
MarkupSafe                1.1.1
packaging                 23.0
pip                       23.0.1
ply                       3.11
pycurl                    7.43.0.6
Pygments                  2.7.1
pyinstaller               5.8.0
pyinstaller-hooks-contrib 2023.0
PySimpleSOAP              1.16.2
python-apt                2.2.1
python-debian             0.1.39
python-debianbts          3.1.0
PyYAML                    5.3.1
reportbug                 7.10.3+deb11u1
requests                  2.25.1
setuptools                67.5.1
six                       1.16.0
toml                      0.10.2
urllib3                   1.26.5
wheel                     0.34.2

Python environment:

root@debian-arm64:~# python3 --version
Python 3.9.2
root@debian-arm64:~# pip --version
pip 23.0.1 from /usr/local/lib/python3.9/dist-packages/pip (python 3.9)

OS specs (debian-11.6.0-arm64):

root@debian-arm64:~# uname -a
Linux debian-arm64 5.10.0-21-arm64 #1 SMP Debian 5.10.162-1 (2023-01-21) aarch64 GNU/Linux

Are you guys able to help there?
Thanks in advance,
Hele.

Asked By: Hele

||

Answers:

FWIW I get the same error in qprocess.sip on an ARM64 MacBook with macOS Ventura 13.2.1 when trying to install pyqt5 with a slightly later version of Qt (5.15.8)

Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:43 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T8112 arm64

I’ve done

$ brew install qt@5 # this installs qt 5.15.8
$ brew install sip

(because the pyqt5 page on PyPi suggests you need qmake on the PATH),

and then

$ pip install pyqt5==5.15.8 --config-settings --confirm-license= --verbose

gives

_in_process.py: /private/var/folders/gw/g898mw1d2319ncb69pn6gvjc0000gn/T/pip-install-9zwmxvzt/pyqt5_ccbcd03a4498442ea37f85e9088bce00/sip/QtCore/qprocess.sip: line 99: column 5: ‘Q_PID’ is undefined

Answered By: ale f.

I founded the following solution that worked for me:

Instead of using pip for installing PyQt5, a PyQt5 package exists.
Installing the package from apt worked for me.

sudo apt-get install python3-PyQt5

Answered By: Hele
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.