You are not logged in.

#1 Yesterday 18:05:52

Everything2067
Member
Registered: 2025-06-29
Posts: 37

hplip error - module 'urllib.request' has no attribute 'URLopener'

I recently found out that the most recent mirror has not synced for a few days. Moved another one to the top and now the system upgrades.
Wiki says that that may have caused a partial upgrade. Ran pacman -Syu a few more times after that. I think that I am up to date now.
However, all executables in the hplip, now do not run and return an error:

Traceback (most recent call last):
  File "/usr/bin/hp-toolbox", line 41, in <module>
    from base import status, tui, module
  File "/usr/share/hplip/base/module.py", line 30, in <module>
    from . import tui, utils, device
  File "/usr/share/hplip/base/device.py", line 2690, in <module>
    class LocalOpener(urllib_request.URLopener):
                      ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'urllib.request' has no attribute 'URLopener'

pacman log says that python (3.13.11-1 -> 3.14.2-2) and python-urllib3 (2.6.2-1 -> 2.6.3-1) have updated. Tried downgrading both and the urllib error is gone, but a new one appears when trying to run any hplip command:

Traceback (most recent call last):
  File "/usr/share/hplip/base/utils.py", line 2536, in import_ext
    return importlib.import_module(ext_name)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'cupsext'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/hp-toolbox", line 41, in <module>
    from base import status, tui, module
  File "/usr/share/hplip/base/status.py", line 59, in <module>
    cupsext = utils.import_ext('cupsext')
  File "/usr/share/hplip/base/utils.py", line 2540, in import_ext
    return importlib.import_module(ext_name)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'cupsext'

Downgrading python-urllib3 alone returns the same urllib3 error. Downgrading python alone returns the cupsext error.
Also downgrading python-pycups does no effect and returns the same errors.
I want to submit a bug report to the maintainer of the hplip package, but before doing that I would like to know if there are any fixes for this, because of what I did.

Offline

#2 Yesterday 18:33:26

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,975

Re: hplip error - module 'urllib.request' has no attribute 'URLopener'

General disclaimer regardless of this particular outcome: Don't downgrade python versions in isolation, you'll potentially break more important parts of the system, python minor versions are incompatible with earlier versions and mandates a rebuild of every python package (which will have happened with the 3.13 -> 3.14 switch)

For the original error, potentially this comment on the AUR for the hplip-plugin package could help: https://aur.archlinux.org/packages/hpli … nt-1054927 and if it does it might well be worth a bug report.

Offline

#3 Yesterday 18:44:58

mithrial
Member
Registered: 2017-03-05
Posts: 124

Re: hplip error - module 'urllib.request' has no attribute 'URLopener'

Looks like that class URLopener was finally removed in 3.14 (https://github.com/python/cpython/issues/84850), after it was deprecated since 3.3.

Seems either HP has to update their ancient code, or the maintainers must provide a patch.

Offline

Board footer

Powered by FluxBB