aarch64架构下安装pyqt5报错

问题描述 投票:0回答:2

我正在尝试在模拟 qemu aarch64 debian 发行版上安装 pyqt5 V5.15.2,但它失败并显示以下跟踪:

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.

我收到的唯一警告是:

  • 以“root”用户身份运行 pip 可能会导致权限破坏以及与系统包管理器的行为冲突。建议改用虚拟环境:https://pip.pypa.io/warnings/venv
  • dbus-python包好像没有安装

说到第一个,每个包安装都在打印它:我不管,那只是一个模拟测试环境。
说到第二个,我已经安装了 libdbus-1-3libdbus-1-dev 并运行了 pip install dbus-python(这似乎是一个已弃用的模块)和 dbus-next ,所以我不知道那里还缺少什么。

问题
显然 qprocess.sip 中的 Q_PID var 似乎未定义

_in_process.py:/tmp/pip-install-m6oiyjbv/pyqt5_1965ddd1193045bab17bb1f59ff08aa1/sip/QtCore/qprocess.sip:第 99 行:第 5 列:“Q_PID”未定义

问题
我究竟做错了什么?我应该如何解决这个错误?

额外信息
安装包列表:

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环境:

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)

操作系统规格 (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

你们能帮忙吗?
提前致谢,
嘿嘿

python pyqt5 arm64
2个回答
0
投票

FWIW 我在 ARM64 MacBook 和 macOS Ventura 13.2.1 上的

qprocess.sip
中遇到同样的错误,当我尝试使用稍晚版本的 Qt (5.15.8)
 进行安装

pyqt5

完成了

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

(因为 PyPi 上的

$ brew install qt@5 # this installs qt 5.15.8
$ brew install sip
 页面建议您在 PATH 上需要
pyqt5
),

然后

qmake

给予

_in_process.py:/private/var/folders/gw/g898mw1d2319ncb69pn6gvjc0000gn/T/pip-install-9zwmxvzt/pyqt5_ccbcd03a4498442ea37f85e9088bce00/sip/QtCore/qprocess.sip⁁:第 99 行:P 列 5 未定义


0
投票
我创建了以下对我有用的解决方案:

不是使用 pip 安装 PyQt5,而是存在一个 PyQt5 包。

从 apt 安装软件包对我有用。

sudo apt-get 安装 python3-PyQt5

© www.soinside.com 2019 - 2024. All rights reserved.