OpenPrinting / system-config-printer

Graphical user interface for CUPS administration
GNU General Public License v2.0
155 stars 87 forks source link

system-config-printer No module named 'cupshelpers' #357

Closed istenburg closed 1 month ago

istenburg commented 2 months ago

Hello, under arch I have installed “system-config-printer” via pacman. Unfortunately, it no longer starts after the python update. system-config-printer Traceback (most recent call last): File "/usr/share/system-config-printer/system-config-printer.py", line 86, in <module> import cupshelpers ModuleNotFoundError: No module named 'cupshelpers'

there is a fix

ajgringo619 commented 2 months ago

As a workaround, this will fix it (tested on EndeavourOS):

sudo ln -sf /usr/lib/python3.12/site-packages/cupshelpers-1.0-py3.12.egg/cupshelpers /usr/lib/python3.12/site-packages/cupshelpers
duck7000 commented 2 months ago

In addition after applying the fix there are some deprecation warnings

/usr/share/system-config-printer/system-config-printer.py:325: DeprecationWarning: Gtk.ActionGroup.list_actions is deprecated
  for action in printer_manager_action_group.list_actions ():
/usr/share/system-config-printer/system-config-printer.py:326: DeprecationWarning: Gtk.Action.set_sensitive is deprecated
  action.set_sensitive (False)
/usr/share/system-config-printer/system-config-printer.py:334: DeprecationWarning: Gtk.ActionGroup.get_action is deprecated
  act = printer_manager_action_group.get_action (action)
/usr/share/system-config-printer/system-config-printer.py:364: DeprecationWarning: Gtk.UIManager.ensure_update is deprecated
  self.ui_manager.ensure_update ()
/usr/share/system-config-printer/system-config-printer.py:365: DeprecationWarning: Gtk.UIManager.get_accel_group is deprecated
  self.PrintersWindow.add_accel_group (self.ui_manager.get_accel_group ())
/usr/share/system-config-printer/system-config-printer.py:374: DeprecationWarning: Gtk.UIManager.get_action is deprecated
  action = self.ui_manager.get_action ("/new-printer")
/usr/share/system-config-printer/system-config-printer.py:375: DeprecationWarning: Gtk.Action.create_menu_item is deprecated
  newprinteritem = action.create_menu_item ()
/usr/share/system-config-printer/system-config-printer.py:673: DeprecationWarning: Gtk.Action.get_proxies is deprecated
  for widget in action.get_proxies ():
/usr/share/system-config-printer/system-config-printer.py:2253: DeprecationWarning: Gdk.threads_enter is deprecated
  Gdk.threads_enter ()
/usr/share/system-config-printer/system-config-printer.py:2204: DeprecationWarning: Gdk.threads_leave is deprecated
  Gdk.threads_leave ()

Everything seems to work though

istenburg commented 2 months ago

and starting the prog causes these error messages


Apr 29 20:12:39 I-NET gvfsd-network[5425]: g_ref_string_new_intern: assertion 'str != NULL' failed
Apr 29 20:12:39 I-NET gvfsd-network[5425]: g_ref_string_new_intern: assertion 'str != NULL' failed
Apr 29 20:12:39 I-NET gvfsd-network[5425]: g_ref_string_new_intern: assertion 'str != NULL' failed
Apr 29 20:12:39 I-NET gvfsd-network[5425]: g_ref_string_release: assertion 'str != NULL' failed
Apr 29 20:12:39 I-NET gvfsd-network[5425]: g_ref_string_release: assertion 'str != NULL' failed
Apr 29 20:12:39 I-NET gvfsd-network[5425]: g_file_info_set_content_type: assertion 'content_type != NULL' failed
Apr 29 20:12:39 I-NET gvfsd-network[5425]: g_file_info_set_content_type: assertion 'content_type != NULL' failed`
ajgringo619 commented 2 months ago

Those deprecations are from the Gtk and Gdk modules, not from cupshelpers

killajoe commented 2 months ago
[20:24:14]  ➜  ~ » ls /usr/lib/python3.10/site-packages/cupshelpers                            
config.py  cupshelpers.py  __init__.py  installdriver.py  openprinting.py  ppds.py  __pycache__  xmldriverprefs.py

with version 1.5.17 the path was correct.

1.5.18:

2024-04-29_20-28

rffontenelle commented 2 months ago

This issue doesn't happen if system-config-printer 1.5.18 is built with Python 3.11. I built with both python 3.11.9 and python 3.12.3 and spotted the difference. Also, there was no changes between 1.5.17 and 1.5.18 related to this installation path.

Actually, no. I had the patch from the linked issue below.

killajoe commented 2 months ago

The issue must be something related to python changes too, if I look at the used package build sources at archlinux gitlab I can see they do already use the 1.5.18 version over a year… The only change is the update on python.

istenburg commented 2 months ago

As a workaround, this will fix it (tested on EndeavourOS):

sudo ln -sf /usr/lib/python3.12/site-packages/cupshelpers-1.0-py3.12.egg/cupshelpers /usr/lib/python3.12/site-packages/cupshelpers

This works, but then I get... /usr/share/system-config-printer/scp-dbus-service.py:602: DeprecationWarning: Gdk.threads_enter is deprecated

rffontenelle commented 2 months ago

This works, but then I get... /usr/share/system-config-printer/scp-dbus-service.py:602: DeprecationWarning: Gdk.threads_enter is deprecated

That's #126.

martinstark commented 2 months ago

Same issue here, just installed system-config-printer for the first time and can't get it to run

thebearingedge commented 2 months ago

The symlink fix worked for me.

istenburg commented 1 month ago

After updating to version 1.5.18.4, I still get error messages:


14:22:09 gvfsd-network: g_file_info_set_content_type: assertion 'content_type != NULL' failed
14:22:09 gvfsd-network: g_file_info_set_content_type: assertion 'content_type != NULL' failed
14:22:09 gvfsd-network: g_ref_string_release: assertion 'str != NULL' failed
14:22:09 gvfsd-network: g_ref_string_release: assertion 'str != NULL' failed
14:22:09 gvfsd-network: g_ref_string_new_intern: assertion 'str != NULL' failed
14:22:09 gvfsd-network: file ../glib/gio/gfileinfo.c: line 1821 (g_file_info_get_content_type): should not be reached
14:22:09 gvfsd-network: GFileInfo created without standard::content-type
14:22:09 gvfsd-network: g_ref_string_new_intern: assertion 'str != NULL' failed
14:22:09 gvfsd-network: file ../glib/gio/gfileinfo.c: line 1821 (g_file_info_get_content_type): should not be reached
14:22:09 gvfsd-network: GFileInfo created without standard::content-type`
killajoe commented 1 month ago

system-config-printer 1.5.18-4 is working without that issue here on arch and arch-based