Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diversion.py import evdev: No module named "evdev" #2422

Open
dtrunk90 opened this issue Apr 6, 2024 · 6 comments
Open

diversion.py import evdev: No module named "evdev" #2422

dtrunk90 opened this issue Apr 6, 2024 · 6 comments

Comments

@dtrunk90
Copy link

dtrunk90 commented Apr 6, 2024

Information

  • Solaar version (solaar --version or git describe --tags if cloned from this repository): 1.1.11
  • Distribution: Ubuntu Budgie 20.04.6 LTS
  • Kernel version (ex. uname -srmo): Linux 5.15.0-101-generic x86_64 GNU/Linux
  • Output of solaar show:
solaar version 1.1.11

Unifying Empfänger
  Device path  : /dev/hidraw1
  USB id       : 046d:C52B
  Serial       : E1AA9657
    Firmware   : 12.11.B0032
    Bootloader : 04.16
    Other      : AA.AA
  Has 1 paired device(s) out of a maximum of 6.
  Notifications: wireless (0x000100)
  Device activity counters: 1=120

  1: MX Vertical Wireless Mouse
     Device path  : /dev/hidraw2
     WPID         : 407B
     Codename     : MX Vertical
     Kind         : mouse
     Protocol     : HID++ 4.5
     Report Rate : 8msms
     Serial number: F439A177
     Model ID:      B020407BC08A
     Unit ID:       3BB072DF
        Bootloader: BOT 78.00.B0009
          Firmware: MPM 16.00.B0009
             Other: 
     Supports 34 HID++ 2.0 features:
         0: ROOT                   {0000} V0     
         1: FEATURE SET            {0001} V0     
         2: DEVICE FW VERSION      {0003} V2     
            Firmware: Bootloader BOT 78.00.B0009 AAE28E5B17FF
            Firmware: Firmware MPM 16.00.B0009 407B8E5B17FF
            Firmware: Other   
            Unit ID: 3BB072DF  Model ID: B020407BC08A  Transport IDs: {'btleid': 'B020', 'wpid': '407B', 'usbid': 'C08A'}
         3: DEVICE NAME            {0005} V0     
            Name: MX Vertical Advanced Ergonomic Mouse
            Kind: mouse
         4: WIRELESS DEVICE STATUS {1D4B} V0     
         5: CONFIG CHANGE          {0020} V0     
         6: CRYPTO ID              {0021} V1     
         7: DEVICE FRIENDLY NAME   {0007} V0     
            Friendly Name: MX Vertical
         8: BATTERY STATUS         {1000} V1     
            Battery: 50%, discharging, next level 20%.
         9: unknown:1002           {1002} V0     
        10: REPROG CONTROLS V4     {1B04} V4     
            Tasten-/Maustastenaktionen (saved): {Left Button:Left Click, Right Button:Right Click, Middle Button:Mouse Middle Button, Back Button:Mouse Back Button, Forward Button:Mouse Forward Button, DPI Switch:DPI Switch}
            Tasten-/Maustastenaktionen        : {Left Button:Left Click, Right Button:Right Click, Middle Button:Mouse Middle Button, Back Button:Mouse Back Button, Forward Button:Mouse Forward Button, DPI Switch:DPI Switch}
            Taste/Maustaste umleiten (saved): {Middle Button:Normal, Back Button:Normal, Forward Button:Normal, DPI Switch:Normal}
            Taste/Maustaste umleiten        : {Middle Button:Normal, Back Button:Normal, Forward Button:Normal, DPI Switch:Normal}
        11: PERSISTENT REMAPPABLE ACTION {1C00} V0     
            Dauerhafte Tasten-/Maustastenzuordnung        : {unknown:0000:No Output (only as default), Left Button:Mouse Button Left, Right Button:Mouse Button Right, Middle Button:Mouse Button Middle, Back Button:Mouse Button Back, Forward Button:Mouse Button Forward}
        12: CHANGE HOST            {1814} V1     
            Anderen Empfänger wählen        : 1:dt
        13: HOSTS INFO             {1815} V1     
            Host 0 (unpaired): dt
            Host 1 (unpaired): 
            Host 2 (unpaired): 
        14: XY STATS               {2250} V0     
        15: unknown:18B1           {18B1} V0    internal, hidden 
        16: VERTICAL SCROLLING     {2100} V0     
            Roller type: standard
            Ratchet per turn: 24
            Scroll lines: 0
        17: LOWRES WHEEL           {2130} V0     
            Wheel Reports: HID
            Mausrad Umleitung (saved): False
            Mausrad Umleitung        : False
        18: ADJUSTABLE DPI         {2201} V1     
            Empfindlichkeit (DPI) (saved): 1600
            Empfindlichkeit (DPI)        : 1600
        19: DEVICE RESET           {1802} V0    internal, hidden 
        20: unknown:1803           {1803} V0    internal, hidden 
        21: CONFIG DEVICE PROPS    {1806} V5    internal, hidden 
        22: unknown:1813           {1813} V0    internal, hidden 
        23: OOBSTATE               {1805} V0    internal, hidden 
        24: unknown:1830           {1830} V0    internal, hidden 
        25: unknown:1890           {1890} V2    internal, hidden 
        26: unknown:1891           {1891} V2    internal, hidden 
        27: unknown:18A1           {18A1} V0    internal, hidden 
        28: unknown:1DF3           {1DF3} V0    internal, hidden 
        29: unknown:1E00           {1E00} V0    hidden 
        30: unknown:1EB0           {1EB0} V0    internal, hidden 
        31: unknown:1E22           {1E22} V0    internal, hidden 
        32: unknown:1861           {1861} V0    internal, hidden 
        33: unknown:18C0           {18C0} V0    internal, hidden 
     Has 7 reprogrammable keys:
         0: Left Button               , default: Left Click                  => Left Click                
             mse, reprogrammable, analytics key events, pos:0, group:1, group mask:g1
             reporting: default
         1: Right Button              , default: Right Click                 => Right Click               
             mse, reprogrammable, analytics key events, pos:0, group:1, group mask:g1
             reporting: default
         2: Middle Button             , default: Mouse Middle Button         => Mouse Middle Button       
             mse, reprogrammable, divertable, persistently divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         3: Back Button               , default: Mouse Back Button           => Mouse Back Button         
             mse, reprogrammable, divertable, persistently divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         4: Forward Button            , default: Mouse Forward Button        => Mouse Forward Button      
             mse, reprogrammable, divertable, persistently divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         5: DPI Switch                , default: DPI Switch                  => DPI Switch                
             mse, reprogrammable, divertable, persistently divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         6: Virtual Gesture Button    , default: Virtual Gesture Button      => Virtual Gesture Button    
             divertable, virtual, raw XY, force raw XY, pos:0, group:3, group mask:empty
             reporting: default
     Has 6 persistent remappable keys:
         0: Left Button                => Mouse Button: Mouse Button Left
         1: Right Button               => Mouse Button: Mouse Button Right
         2: Middle Button              => Mouse Button: Mouse Button Middle
         3: Back Button                => Mouse Button: Mouse Button Back
         4: Forward Button             => Mouse Button: Mouse Button Forward
         5: unknown:0000               => None
     Battery: 50%, discharging, next level 20%.
  • Contents of ~/.config/solaar/config.yaml (or ~/.config/solaar/config.json if ~/.config/solaar/config.yaml not present):
- 1.1.11
- _NAME: Wireless Mouse MX Master 2S
  _sensitive: {hires-scroll-mode: ignore, hires-smooth-invert: ignore, hires-smooth-resolution: ignore}
  _serial: 2B4693A8
  _wpid: '4069'
  dpi: 0x3e8
  hires-smooth-invert: false
  hires-smooth-resolution: true
  smart-shift: 0x10
- _NAME: Wireless Mouse MX Master 2S
  _sensitive: {hires-scroll-mode: ignore, hires-smooth-invert: ignore, hires-smooth-resolution: ignore}
  _serial: 96BB6A0D
  _wpid: '4069'
  dpi: 0x3e8
  hires-smooth-invert: false
  hires-smooth-resolution: true
  smart-shift: 0x10
- _NAME: MX Vertical Wireless Mouse
  _absent: [hi-res-scroll, hires-smooth-invert, hires-smooth-resolution, hires-scroll-mode, scroll-ratchet, smart-shift, thumb-scroll-invert, thumb-scroll-mode,
    onboard_profiles, report_rate, report_rate_extended, pointer_speed, speed-change, backlight, backlight_level, backlight_duration_hands_out, backlight_duration_hands_in,
    backlight_duration_powered, backlight-timed, led_control, led_zone_, fn-swap, disable-keyboard-keys, crown-smooth, divert-crown, divert-gkeys, m-key-leds,
    mr-key-led, multiplatform, gesture2-gestures, gesture2-divert, gesture2-params, sidetone, equalizer, adc_power_management]
  _battery: 4096
  _modelId: B020407BC08A
  _serial: F439A177
  _unitId: 3BB072DF
  _wpid: 407B
  change-host: null
  divert-keys: {0x52: 0x0, 0x53: 0x0, 0x56: 0x0, 0xfd: 0x0}
  dpi: 1600
  lowres-scroll-mode: false
  persistent-remappable-keys: null
  reprogrammable-keys: {0x50: 0x50, 0x51: 0x51, 0x52: 0x52, 0x53: 0x53, 0x56: 0x56, 0xfd: 0xfd}
  • Errors or warrnings from Solaar:

Describe the bug
After installing Solaar from the PPA I get the following error when running:

solaar: error: Traceback (most recent call last):
  File "/usr/share/solaar/lib/solaar/gtk.py", line 157, in main
    import solaar.listener as listener
  File "/usr/share/solaar/lib/solaar/listener.py", line 31, in <module>
    from logitech_receiver import notifications as _notifications
  File "/usr/share/solaar/lib/logitech_receiver/notifications.py", line 25, in <module>
    from . import diversion as _diversion
  File "/usr/share/solaar/lib/logitech_receiver/diversion.py", line 35, in <module>
    import evdev
ModuleNotFoundError: No module named 'evdev'

To Reproduce
Steps to reproduce the behavior:

  1. Run solaar in any terminal emulator

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Same as issue #1514 but using the PPA mentioned in the documentation. The package should add a dependency to the python3-evdev package.

@pfps
Copy link
Collaborator

pfps commented Apr 6, 2024

@antonsoroko Can you investigate?

@antonsoroko
Copy link
Contributor

antonsoroko commented Apr 7, 2024

@dtrunk90 can you show full output of apt show solaar?

b/c i see all the needed dependencies (including python3-evdev):

$ apt show solaar
Package: solaar
Version: 1.1.11~ubuntu23.10.1
Priority: optional
Section: misc
Maintainer: Stephen Kitt <[email protected]>
Installed-Size: 1 699 kB
Depends: debconf (>= 0.5) | debconf-2.0, udev, passwd | adduser, gir1.2-ayatanaappindicator3-0.1, gir1.2-gtk-3.0, gir1.2-notify-0.7, python3-dbus, python3-evdev, python3-gi, python3-psutil, python3-pyudev, python3-xlib, python3-yaml, python3:any
Recommends: upower
Download-Size: 334 kB
APT-Manual-Installed: yes
APT-Sources: https://ppa.launchpadcontent.net/solaar-unifying/stable/ubuntu mantic/main amd64 Packages

same for 20.04 deb file that i just downloaded from PPA:

$ dpkg -I downloads/solaar_1.1.11~ubuntu20.04.1_all.deb
 Package: solaar
 Version: 1.1.11~ubuntu20.04.1
 Architecture: all
 Maintainer: Stephen Kitt <[email protected]>
 Installed-Size: 1660
 Depends: debconf (>= 0.5) | debconf-2.0, udev, passwd | adduser, gir1.2-ayatanaappindicator3-0.1, gir1.2-gtk-3.0, gir1.2-notify-0.7, python3-gi, python3-psutil, python3-pyudev, python3-xlib, python3-yaml, python3:any

maybe you did "forced" install of solaar package via dpkg/apt w/o installing dependencies.

try to do apt purge solaar and then apt install solaar to see if you can reproduce the issue.

--

(for reference the source file for package is https://salsa.debian.org/debian/solaar/-/blob/debian/latest/debian/control?ref_type=heads )

@dtrunk90
Copy link
Author

dtrunk90 commented Apr 7, 2024

Sure:

$ apt show solaar
Package: solaar
Version: 1.1.11~ubuntu20.04.1
Priority: optional
Section: misc
Maintainer: Stephen Kitt <[email protected]>
Installed-Size: 1.700 kB
Depends: debconf (>= 0.5) | debconf-2.0, udev, passwd | adduser, gir1.2-ayatanaappindicator3-0.1, gir1.2-gtk-3.0, gir1.2-notify-0.7, python3-gi, python3-psutil, python3-pyudev, python3-xlib, python3-yaml, python3:any
Recommends: python3-dbus, upower
Download-Size: 308 kB
APT-Manual-Installed: yes
APT-Sources: http://ppa.launchpad.net/solaar-unifying/stable/ubuntu focal/main amd64 Packages
Description: Logitech Unifying Receiver peripherals manager for Linux
 Solaar is a Linux device manager for Logitech's Unifying Receiver wireless
 peripherals. It is able to pair/unpair devices to the receiver, and for
 some devices to read battery status.

I've installed it from the official Ubuntu repo before and upgraded after adding the PPA. Maybe it is/was an apt cache issue?

EDIT: Nope, even after a purge it won't install python3-evdev:

$ LANG=en sudo apt install solaar
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  python3-xlib
The following NEW packages will be installed:
  python3-xlib solaar
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 420 kB of archives.
After this operation, 2476 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

EDIT2: When I download the focal deb from https://launchpad.net/~solaar-unifying/+archive/ubuntu/stable/+packages?field.name_filter=&field.status_filter=published&field.series_filter=focal it's not there either:

$ dpkg -I solaar_1.1.11~ubuntu20.04.1_all.deb 
 neues Debian-Paket, Version 2.0.
 Größe 308076 Byte: control-Archiv= 8992 Byte.
      34 Byte,     1 Zeilen      conffiles            
    1342 Byte,    55 Zeilen   *  config               #!/bin/sh
     716 Byte,    14 Zeilen      control              
    7743 Byte,    98 Zeilen      md5sums              
     525 Byte,    23 Zeilen   *  postinst             #!/bin/sh
     229 Byte,     8 Zeilen   *  postrm               #!/bin/sh
     160 Byte,     9 Zeilen   *  preinst              #!/bin/sh
     387 Byte,    12 Zeilen   *  prerm                #!/bin/sh
   12101 Byte,   130 Zeilen      templates            
 Package: solaar
 Version: 1.1.11~ubuntu20.04.1
 Architecture: all
 Maintainer: Stephen Kitt <[email protected]>
 Installed-Size: 1660
 Depends: debconf (>= 0.5) | debconf-2.0, udev, passwd | adduser, gir1.2-ayatanaappindicator3-0.1, gir1.2-gtk-3.0, gir1.2-notify-0.7, python3-gi, python3-psutil, python3-pyudev, python3-xlib, python3-yaml, python3:any
 Recommends: python3-dbus, upower
 Section: misc
 Priority: optional
 Homepage: https://pwr-solaar.github.io/Solaar/
 Description: Logitech Unifying Receiver peripherals manager for Linux
  Solaar is a Linux device manager for Logitech's Unifying Receiver wireless
  peripherals. It is able to pair/unpair devices to the receiver, and for
  some devices to read battery status.

@antonsoroko
Copy link
Contributor

antonsoroko commented Apr 8, 2024

@dtrunk90 you are right. it was late night and i misread output of my dpkg -I command.

i downloaded and checked content of all latest debs from PPA:
solaar_1.1.11~ubuntu20.04.1_all.deb - does not have python3-evdev in Depends:
solaar_1.1.11~ubuntu22.04.1_all.deb - does have
solaar_1.1.11~ubuntu23.10.1_all.deb - does have
solaar_1.1.11~ubuntu24.04.1_all.deb - does have

i guess this is a bug of specific version of dpkg-buildpackage program (or other tool related to building) that is used in old Ubuntu 20.04 (which is dpkg-dev = 1.19.7ubuntu3.2).

not sure that this can be fixed on our side. we can ask Debian maintainer to explicitly add python3-evdev to Depends: section (currently it added only to Build-Depends-Indep:, so it is implicit, as i see it), but this is a hack and useful only for old Ubuntu - so i am not sure if it is fine idea.

@skitt - if you know, could you please tell your idea/guess why Depends: can be different for different version of distro? (with the same control file i mean, but with different dpkg-dev package)


build logs to compare
https://launchpadlibrarian.net/715460055/buildlog_ubuntu-focal-amd64.solaar_1.1.11~ubuntu20.04.1_BUILDING.txt.gz
https://launchpadlibrarian.net/715460009/buildlog_ubuntu-mantic-amd64.solaar_1.1.11~ubuntu23.10.1_BUILDING.txt.gz

@dtrunk90
Copy link
Author

dtrunk90 commented Apr 8, 2024

Afaik Ubuntu 20.04 is only supported until April 2025 - it's not of a big issue if you have to install the python3-evdev package manually to make it work on that old Ubuntu release. So it's probably better to leave it as it is and don't waste time. But the decision is up to you. Just wanted to report it.

@skitt
Copy link
Contributor

skitt commented May 9, 2024

@skitt - if you know, could you please tell your idea/guess why Depends: can be different for different version of distro? (with the same control file i mean, but with different dpkg-dev package)

I don’t know off-hand, my guess is that the difference is the version of dh-python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants