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: No module named 'inputremapper' #1021

Closed
WyvernDotRed opened this issue Dec 23, 2024 · 8 comments
Closed

ModuleNotFoundError: No module named 'inputremapper' #1021

WyvernDotRed opened this issue Dec 23, 2024 · 8 comments

Comments

@WyvernDotRed
Copy link

WyvernDotRed commented Dec 23, 2024

System Information and logs

  1. input-remapper-control --version
    Errors out with the same error, 2.0.1-2 according to pacman -Q input-remapper-bin.
  2. which linux distro (ubuntu 20.04, manjaro, etc.)
    Garuda Linux (Arch Linux)
  3. which desktop environment (gnome, plasma, xfce4, etc.)
    KDE Plasma 6.2.4
  4. sudo ls -l /proc/1/exe to check if you are using systemd
    lrwxrwxrwx 1 root root 0 23 dec 19:09 /proc/1/exe -> /usr/lib/systemd/systemd
  5. cat ~/.config/input-remapper-2/config.json to see if the "autoload" config is written correctly
    Not the issue at hand, but on my PC:
{
"version": "2.0.1",
"autoload": {
"Logitech M570": "navigation-keys",
"Logitech MX Master 2S": "navigation-keys",
"ELECOM TrackBall Mouse HUGE TrackBall": "ball-scroll-zoom",
"Unicomp GA LLC Aristides 2862": "unix-layout-shift-shift-arrow-media",
"Unicomp Inc Unicomp R7_2_10x_Kbrd_v7_48": "unix-layout-shift-shift-arrow-media-useless-remap",
"AT Translated Set 2 keyboard": "unix-layout-shift-shift-arrow-media"
}
}
  1. systemctl status input-remapper -n 50 the service has to be running
× input-remapper.service - Service to inject keycodes without the GUI application
Loaded: loaded (/usr/lib/systemd/system/input-remapper.service; enabled; preset: disabled)
Active: failed (Result: exit-code) since Mon 2024-12-23 19:19:32 CET; 4min 56s ago
Invocation: 5e4ae39d3fde42f1822c95b6847bbfd1
Process: 93377 ExecStart=/usr/bin/input-remapper-service (code=exited, status=1/FAILURE)
Main PID: 93377 (code=exited, status=1/FAILURE)
Mem peak: 6.5M
CPU: 37ms

dec 23 19:19:32 cave systemd[1]: Starting Service to inject keycodes without the GUI application...
dec 23 19:19:32 cave input-remapper-service[93377]: Traceback (most recent call last):
dec 23 19:19:32 cave input-remapper-service[93377]:   File "/usr/bin/input-remapper-service", line 28, in <module>
dec 23 19:19:32 cave input-remapper-service[93377]:     from inputremapper.logger import update_verbosity, log_info
dec 23 19:19:32 cave input-remapper-service[93377]: ModuleNotFoundError: No module named 'inputremapper'
dec 23 19:19:32 cave systemd[1]: input-remapper.service: Main process exited, code=exited, status=1/FAILURE
dec 23 19:19:32 cave systemd[1]: input-remapper.service: Failed with result 'exit-code'.
dec 23 19:19:32 cave systemd[1]: Failed to start Service to inject keycodes without the GUI application.

Testing the setup

  1. input-remapper-control --command hello
Traceback (most recent call last):
File "/usr/bin/input-remapper-control", line 30, in <module>
from inputremapper.logger import logger, update_verbosity, log_info
ModuleNotFoundError: No module named 'inputremapper'
  1. sudo pkill -f input-remapper-service && sudo input-remapper-service -d & sleep 2 && input-remapper-control --command autoload, are your keys mapped now?
Traceback (most recent call last):
File "/usr/bin/input-remapper-service", line 28, in <module>
from inputremapper.logger import update_verbosity, log_info
ModuleNotFoundError: No module named 'inputremapper'
Traceback (most recent call last):
File "/usr/bin/input-remapper-control", line 30, in <module>
from inputremapper.logger import logger, update_verbosity, log_info
ModuleNotFoundError: No module named 'inputremapper'

fish: Job 1, 'sudo input-remapper-service -d &' has ended
  1. (while the previous command is still running) sudo evtest and search for a device suffixed by "mapped". Select it, does it report any events? Share the output.
    Since the service fails to start, there is no virtual device created.
  2. sudo udevadm control --log-priority=debug && sudo udevadm control --reload-rules && journalctl -f | grep input-remapper, now plug in the device that should autoload
    Output stays quiet on this command.
@WyvernDotRed
Copy link
Author

Rebuilding with paru --rebuild=yes input-remapper-bin, as suggested at #1016 (comment) ,did not solve the issue on my system.
Neither did running paru -Scc, followed by running paru --removemake --cleanafter --redownload --rebuild input-remapper-bin twice, as a thorough method of clearing all caches and cleanly rebuilding.

Using paru input-remapper-git and selecting the AUR package (to avoid the Chaotic-AUR build) did resolve the issue on my system.
After this, input-remapper-control --version yielded:

input-remapper 2.0.1 d902622b5770278b310c3fc15b2244d2c570d22f https://github.com/sezanzeb/input-remapper
python-evdev 1.7.1

The issue is not resolved by this, since the input-remapper-bin AUR package still is broken.
I confirmed this by re-installing it, to the same issues as reported above.
This might be a downstream issue and is the responsibility of AUR user zxp19821005.

@sezanzeb
Copy link
Owner

sezanzeb commented Dec 23, 2024

Hi, check #895 (comment) out for ModuleNotFoundError errors. That might help to figure out the problem with input-remapper-bin.

@sezanzeb
Copy link
Owner

sezanzeb commented Dec 23, 2024

If input-remapper-bin is indeed broken, it's probably best to leave a comment at https://aur.archlinux.org/packages/input-remapper-bin. I'm not maintaining that package.

@WyvernDotRed
Copy link
Author

Hi, check #895 (comment) out for ModuleNotFoundError errors. That might help to figure out the problem with input-remapper-bin.

My outputs from these steps, with the input-remapper-bin package:
2. /usr/lib/python3.12/site-packages/inputremapper
3. ['', '/usr/lib/python313.zip', '/usr/lib/python3.13', '/usr/lib/python3.13/lib-dynload', '/usr/lib/python3.13/site-packages']
4.

Traceback (most recent call last):
File "<python-input-1>", line 1, in <module>
import inputremapper; print(inputremapper.__file__)
^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'inputremapper'
Traceback (most recent call last):
File "<python-input-1>", line 1, in <module>
import inputremapper; print(inputremapper.__file__)
^^^^^^^^^^^^^
NameError: name 'inputremapper' is not defined

And after installing your input-remapper-git AUR package again:
2.

/usr/lib/python3.12/site-packages/inputremapper
/usr/lib/python3.13/site-packages/inputremapper

Well, that is wrong, input-remapper-bin is not getting removed correctly.
Not even with pacman -R input-remapper-bin, despite it being in pacman -Ql input-remapper-bin.
But the issue has become apparent by now, my system updated to the python3.13 path while the input-remapper-bin installs to python3.12.
Which tracks with a recent 5GiB system update, including many Python dependencies.

If input-remapper-bin is indeed broken, it's probably best to leave a comment at https://aur.archlinux.org/packages/input-remapper-bin. I'm not maintaining that package.

On it! Sorry for bothering you with this downstream issue, though this report will be convenient to link to there.

@WyvernDotRed
Copy link
Author

This issue has now been brought to the AUR comments.
User zxp19821005 attempted to resolve the issue: https://aur.archlinux.org/packages/input-remapper-bin#comment-1003383
But this broke the building process, which has been reported in that comment thread.
For keeping this issue complete, I will still cross-post my comment here:

I can confirm @NoReceipt their issue.
Now the python3 folder does gets created in the cache, but it attempts to move the build packages to the non-existent python3.13 folder.

==> Starting build()...
mv: cannot move '/home/wyvern/.cache/paru/clone/input-remapper-bin/src/usr/lib/python3/dist-packages' to '/home/wyvern/.cache/paru/clone/input-remapper-bin/src/usr/lib/python3.13/site-packages': No such file or directory
==> ERROR: A failure occurred in build().

Looking at the diffs of this update, it is peculiar that the previous version did build correctly.
This since the variable applies correctly and leads to identical commands, barring the different python version.

@maxiixam
Copy link

I'm on arch linux and just ran:
yay -S input-remapper-git and chose to clean build all. Installed without issue and program launched without issue. Not sure how helpful this info is, but it got me back up and running.

@Mola7Wika
Copy link

i was having the same problem for 2 days after i updated my system
Try this :
update (pacman -Syu)
install input-remapper-git ( yay -S input-remapper-git)
start the service ( sudo systemctl enable --now input-remapper )
and the app might work, it worked for me

@WyvernDotRed
Copy link
Author

AUR user @zpx19821005 has resolved the issue in package revision input-remapper-bin 2.0.1-4
They mentioned this at https://aur.archlinux.org/packages/input-remapper-bin#comment-1003540
I can confirm that the input-remapper-bin package installs and functions again, after installing it with paru input-remappter-bin.
Followed with the usual sudo systemctl enable input-remapper.service, which is needed after swapping package source when using this method for auto-start.

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

4 participants