You are not logged in.
Hi all,
Since like a week ago, when I try running system-config-printer it fails with the error bellow
File "/usr/share/system-config-printer/system-config-printer.py", line 86, in <module>
import cupshelpers
ModuleNotFoundError: No module named 'cupshelpers'Found the following topic https://bbs.archlinux.org/viewtopic.php?id=295282 which looks exactly like my problem, except that upgrading to hplip 1:3.23.12-5 did not fix it. I have successfully cloned, built and installed the hplip code from the repo provided in that topic by user loqs and I'm still having the issue.
Anyone has any idea for a fix?
Thanks in advance.
Last edited by mdcclxv (2024-05-02 20:04:38)
Offline
The linked version is currently the repo one, https://archlinux.org/packages/extra/x86_64/hplip/ and the important part in loqs' link is the downstream patch https://gitlab.archlinux.org/archlinux/ … 18fb79bb6f
Make sure to restart cups after updating to that version.
Online
You kind of lost me here. The link provided by loqs is to a commit. Isn't that commit supposed to be already included in the repo I cloned?
I did restart cups. I even restarted the PC.
Offline
You don't have to clone anything, just "pacman -Syu hplip" should get you the fixed version.
Let's where we're at:
pacman -Qikk hplipOnline
Here it is. Looks fine to me.
~: sudo pacman -Qikk hplip
Name : hplip
Version : 1:3.23.12-5
Description : Drivers for HP DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet
Architecture : x86_64
URL : https://hplipopensource.com
Licenses : GPL-2.0-or-later MIT BSD-3-Clause-HP IJG GPL-2.0-only LGPL-2.1-or-later BSD-2-Clause LicenseRef-hplip python-ldap
Groups : None
Provides : None
Depends On : python-dbus python-distro ghostscript net-snmp foomatic-db-engine python-gobject libjpeg-turbo dbus gcc-libs avahi python xdg-utils zlib libcups
glibc sh
Optional Deps : cups: for printing support [installed]
sane: for scanner support [installed]
xsane: sane scanner frontend
python-pillow: for commandline scanning support [installed]
python-reportlab: for pdf output in hp-scan
rpcbind: for network support [installed]
python-pyqt5: for running GUI and hp-toolbox [installed]
libusb: for advanced usb support [installed]
wget: for network support [installed]
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 38.36 MiB
Packager : Unknown Packager
Build Date : Wed 01 May 2024 02:20:04 AM EEST
Install Date : Thu 02 May 2024 12:05:24 AM EEST
Install Reason : Explicitly installed
Install Script : No
Validated By : NoneOffline
Re-installed hplip via pacman, same error.
Offline
That looks like the correct package but just compiled by you (unnecessary, but should™ not make any difference)
Can you run hp-setup?
https://bbs.archlinux.org/viewtopic.php?id=295303
Do you use any other printer drivers?
(Did you even use hplip before?)
Online
hp-setup:
~: hp-setup
/usr/local/bin/hp-setup:82: SyntaxWarning: invalid escape sequence '\*'
("To specify the port on a multi-port JetDirect:", "--port=<port> (Valid values are 1\*, 2, and 3. \*default)", "option", False),
/usr/local/bin/hp-setup:86: SyntaxWarning: invalid escape sequence '\*'
("Type of queue(s) to install:", "-t<typelist> or --type=<typelist>. <typelist>: print*, fax\* (\*default) (-i mode only)", "option", False),
/usr/local/share/hplip/base/g.py:305: SyntaxWarning: invalid escape sequence '\|'
spinner = "\|/-\|/-"
/usr/local/share/hplip/base/g.py:355: SyntaxWarning: invalid escape sequence '\d'
m = re.search('python(\d(\.\d){0,2})', ext_path) #get the python version where the .so file is found
/usr/local/share/hplip/base/logger.py:438: SyntaxWarning: invalid escape sequence '\<'
elem_start = re.findall("(\<\W{0,1}\w+) ?", line)[0]
/usr/local/share/hplip/base/logger.py:439: SyntaxWarning: invalid escape sequence '\]'
elem_finished = re.findall("([?|\]\]]*\>)", line)[0]
/usr/local/share/hplip/base/logger.py:441: SyntaxWarning: invalid escape sequence '\S'
attrs = re.findall("(\S*?\=\".*?\")", line)
Traceback (most recent call last):
File "/usr/local/bin/hp-setup", line 47, in <module>
from base.g import *
File "/usr/local/share/hplip/base/g.py", line 240, in <module>
sys_conf = SysConfig()
^^^^^^^^^^^
File "/usr/local/share/hplip/base/g.py", line 185, in __init__
ConfigBase.__init__(self, '/etc/hp/hplip.conf')
File "/usr/local/share/hplip/base/g.py", line 90, in __init__
self.read()
File "/usr/local/share/hplip/base/g.py", line 131, in read
self.conf.readfp(fp)
^^^^^^^^^^^^^^^^
AttributeError: 'ConfigParser' object has no attribute 'readfp'. Did you mean: 'read'?This error has to do with latest python 3.12.3. I read about this invalid escape sequence issue which is fixed by using raw strings.
No other printers. I did use hplip for the last year, it just worked.
Last edited by mdcclxv (2024-05-01 22:21:12)
Offline
pacman -Qo /usr/local/bin/hp-setupYou've some stale copy of hplip in /usr/local
Online
~: sudo pacman -Qo /usr/local/bin/hp-setup
error: No package owns /usr/local/bin/hp-setupHaven't had such an issue up until now. While I do get what you're saying, no idea on what do I need to do.
Offline
Get rid of the stale copy in /usr/local?
pacman -Qlq hplip | sed 's%/usr/%/usr/local/%g'Online
You mean deleting everything that the command above printed?
Offline
Almost. You've a stale copy in /usr/local that shadows the (updated) repo one in /usr and that is not under control of the package manager.
/usr/local/share/ppd/HP/ and /usr/local/share/hplip are gonna make the bulk of that list
/usr/lcoal/share/doc/hplip-3.23.12/ might be a different version, same goes for /usr/local/share/doc/hplip-3.23.12/ and /usr/local/lib/python3.12/site-packages/ and some of the point releases (eg. /usr/local/lib/libhpmud.so.0.0.6) - stay away from /etc and make sure to not just blindly xfer this - you'd delete the entire /usr/local that way.
The immediate offender are the matches in /usr/local/bin - the rest is likely just a clean-up chore.
Last edited by seth (2024-05-01 22:46:21)
Online
Ok, hp-setup runs now. I still get the error when trying system-config-printer.
Offline
Did you only delete the matches in /usr/local/bin or also the other stuff?
strace -f system-config-printer 2>&1 | grep '/local/'might reveal what's still in the way.
Online
~: strace -f system-config-printer 2>&1 | grep '/local/'
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.24/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.22/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.20/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.18/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.16/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.14/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.0/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] openat(AT_FDCWD, "/usr/local/share/glib-2.0/schemas/gschemas.compiled", O_RDONLY|O_CLOEXEC <unfinished ...>
[pid 42205] openat(AT_FDCWD, "/usr/local/share/dconf/profile/user", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.24/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.22/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.20/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.18/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.16/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.14/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.0/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.24/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.22/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.20/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.18/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.16/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.14/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)
[pid 42205] access("/usr/local/share/themes/Silvery-GTK/gtk-3.0/gtk-dark.css", F_OK) = -1 ENOENT (No such file or directory)The thing is that I get the same errors with any GTK theme, including Breeze.
Offline
Deleted the other stuff as well.
Offline
The "ENOENT" are just "is that file t here"?
There's no bogus augmentation left in /usr/local
type system-config-printer
PYTHONVERBOSE=3 /usr/bin/system-config-printerOnline
This solved the issue for me.
It was an issue with system-config-printers and the recent python updates. Just a simple change of folders.
https://github.com/OpenPrinting/system- … issues/357
sudo ln -sf /usr/lib/python3.12/site-packages/cupshelpers-1.0-py3.12.egg/cupshelpers /usr/lib/python3.12/site-packages/cupshelpersLast edited by nicks (2024-05-02 14:35:55)
Offline
That's rather weird, though. Most users on that thread seem to use EOS, do you as well?
Online
The symlink trick fixed it for me as well, it's working now, although with all the errors mentioned on the github thread.
Thank you guys both for your time and effort.
Offline
I'm not gonna hold that against you, but is this EOS?
Otherwise somebody needs to file a bug against the package, but this doesn't seem to be an issue for others who ultimately just ran into the hplip error.
Online
I'm not on EOS. Pure Arch here, installed from scratch.
Offline
Otherwise somebody needs to file a bug against the package, but this doesn't seem to be an issue for others who ultimately just ran into the hplip error.
Not sure which package are you referring to. Python? Cupshelpers? No idea who is actually responsible for the wrong name on that site-package.
Offline
https://gitlab.archlinux.org/archlinux/ … r/-/issues
But w/ https://github.com/OpenPrinting/system- … issues/358 this might be a genuine upstream issue - though I don't really understand why it's not just for everyone.
Do you have some python packages installed via pip?
Online