You are not logged in.

#1 2024-05-01 21:32:43

mdcclxv
Member
Registered: 2022-04-26
Posts: 207

[SOLVED] system-config-printer failing

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

#2 2024-05-01 21:39:33

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,314

Re: [SOLVED] system-config-printer failing

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.

Offline

#3 2024-05-01 21:59:41

mdcclxv
Member
Registered: 2022-04-26
Posts: 207

Re: [SOLVED] system-config-printer failing

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

#4 2024-05-01 22:03:27

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,314

Re: [SOLVED] system-config-printer failing

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 hplip

Offline

#5 2024-05-01 22:05:46

mdcclxv
Member
Registered: 2022-04-26
Posts: 207

Re: [SOLVED] system-config-printer failing

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    : None

Offline

#6 2024-05-01 22:15:58

mdcclxv
Member
Registered: 2022-04-26
Posts: 207

Re: [SOLVED] system-config-printer failing

Re-installed hplip via pacman, same error.

Offline

#7 2024-05-01 22:16:04

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,314

Re: [SOLVED] system-config-printer failing

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?)

Offline

#8 2024-05-01 22:19:45

mdcclxv
Member
Registered: 2022-04-26
Posts: 207

Re: [SOLVED] system-config-printer failing

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

#9 2024-05-01 22:21:54

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,314

Re: [SOLVED] system-config-printer failing

pacman -Qo /usr/local/bin/hp-setup

You've some stale copy of hplip in /usr/local

Offline

#10 2024-05-01 22:24:05

mdcclxv
Member
Registered: 2022-04-26
Posts: 207

Re: [SOLVED] system-config-printer failing

~: sudo pacman -Qo /usr/local/bin/hp-setup
error: No package owns /usr/local/bin/hp-setup

Haven'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

#11 2024-05-01 22:30:13

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,314

Re: [SOLVED] system-config-printer failing

Get rid of the stale copy in /usr/local?

pacman -Qlq hplip | sed 's%/usr/%/usr/local/%g'

Offline

#12 2024-05-01 22:35:53

mdcclxv
Member
Registered: 2022-04-26
Posts: 207

Re: [SOLVED] system-config-printer failing

You mean deleting everything that the command above printed?

Offline

#13 2024-05-01 22:46:06

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,314

Re: [SOLVED] system-config-printer failing

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)

Offline

#14 2024-05-01 23:00:31

mdcclxv
Member
Registered: 2022-04-26
Posts: 207

Re: [SOLVED] system-config-printer failing

Ok, hp-setup runs now. I still get the error when trying system-config-printer.

Offline

#15 2024-05-01 23:02:57

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,314

Re: [SOLVED] system-config-printer failing

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.

Offline

#16 2024-05-01 23:07:21

mdcclxv
Member
Registered: 2022-04-26
Posts: 207

Re: [SOLVED] system-config-printer failing

~: 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

#17 2024-05-01 23:17:11

mdcclxv
Member
Registered: 2022-04-26
Posts: 207

Re: [SOLVED] system-config-printer failing

Deleted the other stuff as well.

Offline

#18 2024-05-02 05:56:58

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,314

Re: [SOLVED] system-config-printer failing

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-printer

Offline

#19 2024-05-02 14:27:56

nicks
Member
Registered: 2019-07-14
Posts: 11

Re: [SOLVED] system-config-printer failing

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/cupshelpers

Last edited by nicks (2024-05-02 14:35:55)

Offline

#20 2024-05-02 18:43:33

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,314

Re: [SOLVED] system-config-printer failing

That's rather weird, though. Most users on that thread seem to use EOS, do you as well?

Offline

#21 2024-05-02 20:03:55

mdcclxv
Member
Registered: 2022-04-26
Posts: 207

Re: [SOLVED] system-config-printer failing

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

#22 2024-05-02 20:06:29

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,314

Re: [SOLVED] system-config-printer failing

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.

Offline

#23 2024-05-02 20:30:11

mdcclxv
Member
Registered: 2022-04-26
Posts: 207

Re: [SOLVED] system-config-printer failing

I'm not on EOS. Pure Arch here, installed from scratch.

Offline

#24 2024-05-02 20:50:04

mdcclxv
Member
Registered: 2022-04-26
Posts: 207

Re: [SOLVED] system-config-printer failing

seth wrote:

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

#25 2024-05-02 21:09:18

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,314

Re: [SOLVED] system-config-printer failing

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?

Offline

Board footer

Powered by FluxBB