hp-setup python3 erro: não é possível importar o nome '_gobject'

0

Eu comecei a receber esse erro no Arch Linux. O hp-setup tem funcionado bem até agora. Eu não entendo a mensagem de erro.

hp-setup

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

Copyright (c) 2001-15 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.

Traceback (most recent call last):
  File "/usr/bin/hp-setup", line 313, in <module>
    ui = import_module(ui_package + ".setupdialog")
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/share/hplip/ui5/setupdialog.py", line 31, in <module>
    from base import device, utils, models, pkit
  File "/usr/share/hplip/base/pkit.py", line 38, in <module>
    from gi import _gobject as gobject
ImportError: cannot import name '_gobject'

Depois de ver este erro, eu reinstalei o hplip (que é o pacote que possui o arquivo hp-setup).

pacman -Qo /usr/share/hplip/setup.py                                                                       
/usr/share/hplip/setup.py is owned by hplip 3.17.11-1

Isso não resolveu o problema.

O erro ocorre sem nenhuma opção de linha de comando (cujo padrão é o modo GUI) ou com a opção --gui . No entanto, com a opção --interactive (que é um modo somente texto), não obtenho o erro.

Outro computador Arch com uma configuração idêntica (no que diz respeito a pacotes instalados e configurações) não possui o erro (mesmo com o modo GUI).

Atualização 1:

$ pacman -Qi hplip

Name            : hplip
Version         : 3.17.11-1
Description     : Drivers for HP DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet
Architecture    : x86_64
URL             : http://hplipopensource.com
Licenses        : GPL
Groups          : None
Provides        : None
Depends On      : python-dbus  ghostscript  net-snmp  foomatic-db-engine
Optional Deps   : cups: for printing support [installed]
                  sane: for scanner support [installed]
                  xsane: sane scanner frontend [installed]
                  python-pillow: for commandline scanning support
                  python-reportlab: for pdf output in hp-scan
                  rpcbind: for network support [installed]
                  python-pyqt5: for running GUI and hp-toolbox [installed]
                  python-gobject: for running 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  : 24.55 MiB
Packager        : Andreas Radke
Build Date      : Mon 04 Dec 2017 03:46:16 PM EST
Install Date    : Sun 17 Dec 2017 11:11:35 AM EST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature
    
por MountainX 23.02.2018 / 08:29

1 resposta

1

A solução foi simples:

pacman -S --needed python-gobject

e, de fato, precisava ser instalado.

O relatório de pacman -Qi hplip que indicou:

python-gobject: for running hp-toolbox [installed]

foi enganador. Quando eu corri o pacman -Qi python-gobject , descobri que ele não estava realmente instalado. Instalá-lo resolveu o problema.

    
por 24.02.2018 / 07:12