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

ImportError when running the program (installation seems to work fine) #16

Open
PlexSheep opened this issue Nov 18, 2024 · 1 comment
Open

Comments

@PlexSheep
Copy link

Tl;Dr: ImportError: cannot import name 'Receiver' from 'logitech_receiver' (/home/plex/.local/lib/python3.10/site-packages/logitech_receiver/__init__.py) when running the thing, but installation says success.

Installation went successfully like this:

%  pip install --user -e $PWD                          
Obtaining file:///home/plex/Documents/code/py/logitech-m720-config
  Preparing metadata (setup.py) ... done
Requirement already satisfied: solaar in /home/plex/.local/lib/python3.10/site-packages (from m720-config==0.0.1) (1.1.13)
Requirement already satisfied: pyudev>=0.13 in /home/plex/.local/lib/python3.10/site-packages (from solaar->m720-config==0.0.1) (0.24.3)
Requirement already satisfied: PyYAML>=3.12 in /usr/lib/python3/dist-packages (from solaar->m720-config==0.0.1) (5.4.1)
Requirement already satisfied: PyGObject in /usr/lib/python3/dist-packages (from solaar->m720-config==0.0.1) (3.42.1)
Requirement already satisfied: dbus-python in /usr/lib/python3/dist-packages (from solaar->m720-config==0.0.1) (1.2.18)
Requirement already satisfied: psutil>=5.4.3 in /usr/lib/python3/dist-packages (from solaar->m720-config==0.0.1) (5.9.0)
Requirement already satisfied: python-xlib>=0.27 in /usr/lib/python3/dist-packages (from solaar->m720-config==0.0.1) (0.29)
Requirement already satisfied: evdev>=1.1.2 in /usr/lib/python3/dist-packages (from solaar->m720-config==0.0.1) (1.4.0)
Requirement already satisfied: pycairo>=1.16.0 in /usr/lib/python3/dist-packages (from PyGObject->solaar->m720-config==0.0.1) (1.20.1)
Installing collected packages: m720-config
  Attempting uninstall: m720-config
    Found existing installation: m720-config 0.0.1
    Uninstalling m720-config-0.0.1:
      Successfully uninstalled m720-config-0.0.1
  Running setup.py develop for m720-config
Successfully installed m720-config

BUT

% m720-config
Traceback (most recent call last):
  File "/home/plex/.local/bin/m720-config", line 33, in <module>
    sys.exit(load_entry_point('m720-config', 'console_scripts', 'm720-config')())
  File "/home/plex/.local/bin/m720-config", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/plex/Dokumente/code/py/logitech-m720-config/m720_config/__init__.py", line 21, in <module>
    from logitech_receiver import Receiver
ImportError: cannot import name 'Receiver' from 'logitech_receiver' (/home/plex/.local/lib/python3.10/site-packages/logitech_receiver/__init__.py)

There is a receiver module in logitech_receiver, and using from logitech_receiver.receiver import Receiver brings us a bit farther:

% m720-config
rules cannot access modifier keys in Wayland, accessing process only works on GNOME with Solaar Gnome extension installed
### CURRENTLY CONNECTED DEVICES ###
     path     vendor_id product_id serial release manufacturer product interface driver               bus_id isDevice
/dev/hidraw10 046D      C52B              None    None         None    2         logitech-djreceiver  3      None    

Traceback (most recent call last):
  File "/home/plex/.local/bin/m720-config", line 8, in <module>
    sys.exit(main())
  File "/home/plex/.local/lib/python3.10/site-packages/m720_config/__init__.py", line 156, in main
    buttons = SpecialKeysMseButtons ()
  File "/home/plex/.local/lib/python3.10/site-packages/m720_config/__init__.py", line 36, in __init__
    self.receiver = Receiver.open (device_info)
AttributeError: type object 'Receiver' has no attribute 'open'

But still not to a functional program. Indeed, I could not find the open method in logitech_receiver.

Additional Information

System:
  Host: theseus Kernel: 6.9.3-76060903-generic x86_64 bits: 64
    Desktop: GNOME 42.9 Distro: Pop!_OS 22.04 LTS
@PlexSheep
Copy link
Author

Possibly related to #15

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

No branches or pull requests

1 participant