1

我正在尝试在 ARM Linux(Debian Buster 10)上安装 Qt5 for Python。Python 的版本是 3.7.3。我已经使用 apt 命令安装了 Qt5:

sudo apt-get install qt5-default pyqt5-dev pyqt5-dev-tools

当尝试进入 Python3 时,如果我使用声明:

from PyQt5.QtWidgets import QApplication, QLabel

导入工作正常(我没有收到任何错误)。

但是当我继续:

app = QApplication([])

我得到了错误:

qt.qpa.xcb: QXcbConnection: XCB error: 148 (Unknown), sequence: 181, resource id: 0, major code: 140 (Unknown), minor code: 20

如果我尝试从 pip 安装 PyQt5,我得到了这个

sudo pip3 install pyqt5
Collecting pyqt5
  Using cached https://files.pythonhosted.org/packages/3a/fb/eb51731f2dc7c22d8e1a63ba88fb702727b324c6352183a32f27f73b8116/PyQt5-5.14.1.tar.gz
  Installing build dependencies ... done
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python3.7/tokenize.py", line 447, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-_70atgk5/pyqt5/setup.py'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-_70atgk5/pyqt5/

对不起,但我不明白问题出在哪里。谢谢。

4

0 回答 0