升级后修复 HP 打印机软件(在 Arch Linux 上)

升级后修复 HP 打印机软件(在 Arch Linux 上)

我正在尝试运行惠普的打印机软件,该软件最近升级并破坏了我的所有打印功能。我运行着一个不断升级的 Arch(截至 2021 年 2 月 28 日,版本为 2014 年 10 月 5 日)。显然他们现在使用 Qt,所以这是某种要求,所以我花了 2 个小时构建所有这些 Qt 东西。惠普要求 Linux 用户花费数小时构建晦涩的软件包以便他们可以打印,这似乎很疯狂。lpstat -a说打印机已准备好并正在工作/空闲,但没有任何内容可以打印到它们。 cups 日志显示打印因“后端错误”而失败。

不管怎样,hp-setup 现在只是在启动时挂起,并且 hp-check 给出了 PyQt4 无法导入 QtCore 的错误,这是 PyQt 用户尝试验证他们正在运行的 Qt 版本的标准方法。因此,显然两者之间存在某种版本冲突。这是我的点列表的相关部分:

PyOpenGL 3.1.5
pyOpenSSL 20.0.1
pyparsing 2.4.7
PyQt3D 5.15.2
PyQt4-sip 4.19.24
PyQt5 5.15.2
PyQt5-sip 12.8.1
PyQtChart 5.15.2
PyQt数据可视化 5.15.2
PyQt采购5.15.2
PyQtWebEngine 5.15.2

那么,问题是我的系统上有 PyQt5 而 HP 软件需要 PyQt4 吗?如果是这样,我可以将两者放在同一个系统上吗?诊断此问题的程序是什么?

$ sudo find /usr -name "PyQt*"
/usr/share/qt/qsci/api/python/PyQtDataVisualization.api
/usr/share/qt/qsci/api/python/PyQtPurchasing.api
/usr/share/qt/qsci/api/python/PyQtWebEngine.api
/usr/share/qt/qsci/api/python/PyQt3D.api
/usr/share/qt/qsci/api/python/PyQt5.api
/usr/share/qt/qsci/api/python/PyQtChart.api
/usr/lib/qt/plugins/PyQt5
/usr/lib/python3.9/site-packages/PyQtChart-5.15.3.dist-info
/usr/lib/python3.9/site-packages/PyQt5_sip-12.8.1-py3.9.egg-info
/usr/lib/python3.9/site-packages/PyQtPurchasing-5.15.3.dist-info
/usr/lib/python3.9/site-packages/PyQt4
/usr/lib/python3.9/site-packages/PyQt5
/usr/lib/python3.9/site-packages/PyQt3D-5.15.3.dist-info
/usr/lib/python3.9/site-packages/PyQtDataVisualization-5.15.3.dist-info
/usr/lib/python3.9/site-packages/PyQt4_sip-4.19.24.dist-info
/usr/lib/python3.9/site-packages/PyQt5-5.15.3.dist-info
/usr/lib/python3.9/site-packages/PyQtWebEngine-5.15.3.dist-info
/usr/lib/python2.7/site-packages/PyQt4
/usr/lib/python2.7/site-packages/PyQt4_sip-4.19.24.dist-info

HPLIP_DEBUG=1 hp-setup 的输出:


HP Linux Imaging and Printing System (ver. 3.21.2)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

hp-setup[711208]: debug: param=
hp-setup[711208]: debug: selected_device_name=None
hp-setup[711208]: debug: Using PyQt5
hp-setup[711208]: debug: Sys.argv=['/usr/bin/hp-setup'] printer_name=None param= jd_port=1 device_uri=None remove=False
hp-setup[711208]: debug: Starting GUI Event Loop...
Searching... (bus=net, timeout=5, ttl=4, search=(None) desc=0, method=slp)
error: No devices found on bus: net
error:  HPLIP cannot detect printers in your network.  This may be due to existing firewall settings blocking the required ports.
                When you are in a trusted network environment, you may open the ports for network services like mdns and slp in the firewall. For detailed steps follow the link.
                 http://hplipopensource.com/node/374 

答案1

例如,在 Ubuntu 20.10 上,该hplip包实际上将与 PyQt5 一起运行 ( python3-pyqt5)。同样在 Arch 上,hplip软件包版本 3.21.2-1 使用 Qt 5。因此,无需安装 Qt 4。

使用的Qt版本实际上是在以下配置中配置的/etc/hp/hplip.conf

[configure]
ui-toolkit=qt5
qt3=no
qt4=no
qt5=yes

当我运行时,hp-check它确实提到PyQt4无法找到,但它没有在末尾列出它Missing Required Dependencies。如果你问我,这个工具不太值得信赖。

为了了解 Python 方面发生了什么,我首先尝试找出 Qt 绑定的安装位置:

$ find /usr -name "PyQt*"

您的系统上可能有多个 Python 版本,每个版本都有不同的包目录。尝试使用您认为已安装所有依赖项的 Python 解释器显式调用该工具,例如:

$ export HPLIP_DEBUG=1
$ python3.9 $(where hp-setup)

我希望在控制台输出中得到一些关于出现问题的提示。

更进一步可能是运行 Python 调试器。

如果发现使用了错误的 Python 解释器,请确保它python指向正确的版本:

$ python --version

但是,在查看您现在提供的附加控制台输出时,我认为这与 PyQt/Qt 没有任何关系,特别是由于:

error: No devices found on bus: net

这在某种程度上似乎与网络有关,因为发现(SLP)失败。

相关内容