flozz / rivalcfg

CLI tool and Python library to configure SteelSeries gaming mice
https://flozz.github.io/rivalcfg/
Do What The F*ck You Want To Public License
797 stars 65 forks source link

ModuleNotFoundError #237

Open hirax02 opened 4 days ago

hirax02 commented 4 days ago

I have Ubuntu based KDE Neon. It upgraded itself recently and now based on Ubuntu 24.04.1 LTS. I had installed rivalcfg previously and it worked well. After system upgrade it didnt work anymore. I tried reinstall it but then I got same "externally-managed-environment error" as described here #235 Then I did by Your direction from previously mentioned topic:

sudo apt install python3-venv
python3 -m venv ./rivalcfg.env
./rivalcfg.env/bin/pip install rivalcfg

and rivalcfg installed

./rivalcfg.env/bin/pip install rivalcfg
Collecting rivalcfg
  Downloading rivalcfg-4.13.0-py3-none-any.whl.metadata (26 kB)
Collecting hidapi>=0.14.0 (from rivalcfg)
  Downloading hidapi-0.14.0.post2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.6 kB)
Collecting setuptools (from rivalcfg)
  Downloading setuptools-75.1.0-py3-none-any.whl.metadata (6.9 kB)
Downloading rivalcfg-4.13.0-py3-none-any.whl (79 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.4/79.4 kB 329.2 kB/s eta 0:00:00
Downloading hidapi-0.14.0.post2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (711 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 711.6/711.6 kB 520.9 kB/s eta 0:00:00
Downloading setuptools-75.1.0-py3-none-any.whl (1.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 483.0 kB/s eta 0:00:00
Installing collected packages: setuptools, hidapi, rivalcfg
Successfully installed hidapi-0.14.0.post2 rivalcfg-4.13.0 setuptools-75.1.0

but there was warning

./rivalcfg.env/bin/rivalcfg --help
W: Installed udev rules were generated by an other rivalcfg version.
   Run 'rivalcfg --update-udev' as root to update.

and when I tried update udev, then I got NoModule error:

sudo rivalcfg --update-udev
[sudo] parool hirax jaoks: 
Traceback (most recent call last):
  File "/usr/local/bin/rivalcfg", line 5, in <module>
    from rivalcfg.__main__ import main
ModuleNotFoundError: No module named 'rivalcfg'

What to do next ? Can You help me ?

flozz commented 3 days ago

Hello,

Please try with the following command:

sudo ./rivalcfg.env/bin/rivalcfg --update-udev

It should work, but in case it doesn't work better, try:

sudo bash
./rivalcfg.env/bin/rivalcfg --update-udev
exit

:)

hirax02 commented 3 days ago

Unfortunately, the result is the same error

sudo bash
[sudo] parool hirax jaoks: 
root@Ordi-laptop:/home/hirax# rivalcfg --update-udev
Traceback (most recent call last):
  File "/usr/local/bin/rivalcfg", line 5, in <module>
    from rivalcfg.__main__ import main
ModuleNotFoundError: No module named 'rivalcfg'
root@Ordi-laptop:/home/hirax# 
flozz commented 3 days ago

You may be missed I edited the message just after writing it (so if you read the response from the mail, it was not accurate) :)

hirax02 commented 3 days ago

Now I am even more confused... I do something wrong or I simply don't know what to do

hirax@Ordi-laptop:~$ sudo ./rivalcfg.env/bin/rivalcfg --update-udev
[sudo] parool hirax jaoks: 
hirax@Ordi-laptop:~$ rivalcfg --battery-level
Traceback (most recent call last):
  File "/usr/local/bin/rivalcfg", line 5, in <module>
    from rivalcfg.__main__ import main
ModuleNotFoundError: No module named 'rivalcfg'
hirax@Ordi-laptop:~$ ./rivalcfg.env/bin/rivalcfg --battery-level
Traceback (most recent call last):
  File "/home/hirax/./rivalcfg.env/bin/rivalcfg", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/hirax/rivalcfg.env/lib/python3.12/site-packages/rivalcfg/__main__.py", line 106, in main
    battery_info = mouse.battery
                   ^^^^^^^^^^^^^
  File "/home/hirax/rivalcfg.env/lib/python3.12/site-packages/rivalcfg/mouse.py", line 167, in battery
    if result["level"] > 100 or result["level"] < 0:
       ^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'NoneType' and 'int'
hirax@Ordi-laptop:~$ sudo bash
./rivalcfg.env/bin/rivalcfg --update-udev
exit
root@Ordi-laptop:/home/hirax# rivalcfg --battery-level
Traceback (most recent call last):
  File "/usr/local/bin/rivalcfg", line 5, in <module>
    from rivalcfg.__main__ import main
ModuleNotFoundError: No module named 'rivalcfg'
root@Ordi-laptop:/home/hirax# 
hirax02 commented 3 days ago

Maybe I got it.. Now I must always start commands with: ./rivalcfg.env/bin/rivalcfg --"some option" not simply: rivalcfg --"some option" ??

hirax02 commented 3 days ago

Maybe this helps at least little

hirax@Ordi-laptop:~$ ./rivalcfg.env/bin/rivalcfg --print-debug

RIVALCFG
========
Version: 4.13.0
udev rules installed: True
udev rules up to date: True
Installation path: /home/hirax/rivalcfg.env/lib/python3.12/site-packages/rivalcfg

OPERATING SYSTEM
================
OS: Linux
Platform: Linux-6.8.0-45-generic-x86_64-with-glibc2.39
Version: #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024
Distribution issue: KDE neon 6.2 \n \l

PYTHON
======
Python version: 3.12.3
HIDAPI version: 0.14.0.post2

PLUGGED STEELSERIES DEVICES ENDPOINTS
=====================================
1038:1838 | 00 | SteelSeries Aerox 3 Wireless (firmware v0)
1038:1838 | 00 | SteelSeries Aerox 3 Wireless (firmware v0)
1038:1838 | 01 | SteelSeries Aerox 3 Wireless (firmware v0)
1038:1838 | 02 | SteelSeries Aerox 3 Wireless (firmware v0)
1038:1838 | 03 | SteelSeries Aerox 3 Wireless (firmware v0)
1038:1838 | 04 | SteelSeries Aerox 3 Wireless (firmware v0)
flozz commented 2 days ago

Maybe I got it.. Now I must always start commands with: ./rivalcfg.env/bin/rivalcfg --"some option" not simply: rivalcfg --"some option"

Yes you got it right, the you shloud use ./rivalcfg.env/bin/rivalcfg instead of simple rivalcfg