Error installing pyqt5 under aarch64 architecture.

huangapple go评论179阅读模式
英文:

Error installing pyqt5 under aarch64 architecture

问题

你正在尝试在模拟的qemu aarch64 debian系统上安装pyqt5 V5.15.2,但遇到以下错误跟踪:

问题似乎出在qprocess.sip文件的第99行,报告“Q_PID”未定义。你的操作系统和Python环境如下:

  • 操作系统:Debian 11.6.0 (arm64)
  • Python版本:3.9.2
  • pip版本:23.0.1

你提到了两个警告信息:

  1. 以root用户身份运行pip可能会导致权限问题和与系统包管理器的冲突。建议在虚拟环境中使用pip,你可以参考链接了解更多详情。

  2. 检测到dbus-python包未安装。你已经尝试安装了_libdbus-1-3_和_libdbus-1-dev_,并运行了pip install dbus-python_和_dbus-next。然而,你仍然遇到问题。

针对你的问题,有几个可能的解决方法:

  • 请确保你的系统上已经安装了Qt和相关的开发工具,因为PyQt5依赖于Qt库。你可以检查Qt的版本和配置。

  • 确保你的系统中没有名为Q_PID的冲突变量或标识符。

  • 尝试更新或重新安装PyQt5,或者考虑使用虚拟环境,以避免权限问题。

  • 查看PyQt5的文档和社区支持,以获取有关在aarch64 debian上安装的更多帮助。

希望这些提示对你有所帮助。如果你需要更多帮助,请提供更多关于你的问题和系统配置的信息,以便我们能够更好地协助你。

英文:

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.

答案1

得分: 0

对不起,代码部分不要翻译。以下是已经翻译好的内容:

FWIW,我在使用 macOS Ventura 13.2.1 上的 ARM64 MacBook 安装稍后版本的 Qt(5.15.8)并尝试安装 pyqt5 时,在 qprocess.sip 中遇到了相同的错误。以下是一些系统信息:

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

我已经执行了以下操作:

$ brew install qt@5 # 这将安装 Qt 5.15.8
$ brew install sip

(因为pyqt5页面在 PyPi 上建议在 PATH 中需要 qmake),

然后执行了:

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

但是出现了以下错误信息:

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

英文:

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

答案2

得分: 0

我找到了以下适合我的解决方案:

不要使用pip来安装PyQt5,存在一个PyQt5软件包。
从apt中安装该软件包对我有用。

sudo apt-get install python3-PyQt5

英文:

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

huangapple
  • 本文由 发表于 2023年3月8日 17:44:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/75671456.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定