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

ModuleNotFoundError #237

Open
hirax02 opened this issue Oct 11, 2024 · 7 comments
Open

ModuleNotFoundError #237

hirax02 opened this issue Oct 11, 2024 · 7 comments
Assignees

Comments

@hirax02
Copy link

hirax02 commented Oct 11, 2024

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
Copy link
Owner

flozz commented Oct 12, 2024

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

:)

@flozz flozz self-assigned this Oct 12, 2024
@hirax02
Copy link
Author

hirax02 commented Oct 13, 2024

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
Copy link
Owner

flozz commented Oct 13, 2024

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
Copy link
Author

hirax02 commented Oct 13, 2024

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
Copy link
Author

hirax02 commented Oct 13, 2024

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

@hirax02
Copy link
Author

hirax02 commented Oct 13, 2024

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
Copy link
Owner

flozz commented Oct 14, 2024

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

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

2 participants