Caffeine-ng raises an error after update

Caffeine raises an error with the recently update to Python 3.11:

Traceback (most recent call last):
  File "/usr/bin/caffeine", line 3, in <module>
    from caffeine.cli import cli
  File "/usr/lib/python3.11/site-packages/caffeine/cli.py", line 10, in <module>
    from caffeine.main import GUI
  File "/usr/lib/python3.11/site-packages/caffeine/main.py", line 52, in <module>
    from caffeine.core import Caffeine  # noqa: E402
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/caffeine/core.py", line 41, in <module>
    from caffeine.triggers import DesiredState
  File "/usr/lib/python3.11/site-packages/caffeine/triggers.py", line 11, in <module>
    from pulsectl import Pulse
ModuleNotFoundError: No module named 'pulsectl'

Looks like you probably need python-pulsectl

I installed it manually, but I think it should be added as a dep of the caffeine package.

$ pamac info caffeine-ng
Name                  : caffeine-ng
Version               : 4.2.0-2
[...]
Depends On            : dbus-python gtk3 hicolor-icon-theme libayatana-appindicator libnotify python-click python-ewmh python-gobject
                        python-pulsectl python-setproctitle
[...]

python-pulsectl is already a dependency of caffeine-ng.

Don’t mix system and local Python packages. See

Well, it’s installed:

$ pamac search -i python-pulsectl
python-pulsectl                                                                                                                     23.5.1-1  community 
    Python high-level interface and ctypes-based bindings for PulseAudio (libpulse)

So, caffeine’s python is not the same as this package?

Notice, that I simply upgrade the system with the GUI of Pacman, and it stopped working until I installed pulsectl manually.