program doesn't find libsuinput files (xfce)

Bug #1045385 reported by Sarah Van Bogaert
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-uinput
Fix Committed
Medium
a

Bug Description

Hi,

I first installed the python-uinput program on Gnome (in Debian) and it works properly for my application. However, when I installed it the same way on Xfce (also Debian), it crashes at initialization. Indeed, when reading the last line of the code:

import uinput
events = (uinput.KEY_LEFTCTRL,)
device = uinput.Device(events)

it crashes and shows this error message:

File "/usr/local/lib/python2.6/dist-packages/uinput/__init__.py", line 108, in __init__
    self.__uinput_fd = _libsuinput.suinput_open()
File "/usr/local/lib/python2.6/dist-packages/uinput/__init__.py", line 65, in _error_handler
    raise OSError(code, os.strerror(code))
OSError: [Errno 2] No such file or directory

The file _libsuinput.so is where it should be, i.e. in /usr/local/lib/python2.6/dist-packages/

Thanks

Revision history for this message
Sarah Van Bogaert (svbg) wrote :

I am using version version 0.9 of python-uinput and version 2.6.6 of python.

Revision history for this message
Sarah Van Bogaert (svbg) wrote :

The same message appears when I run the example programs mouse.py, joystick.py and keyboard.py

Revision history for this message
a (tuomasjjrasanen) wrote :

Hi and thanks for reporting this issue.

It seems that root cause for this error message is that the uinput device file (the file which is used to initialize and create uinput devices) cannot be found.

Could you please run following command and then report the output:

udevadm info --query=all --path=/devices/virtual/misc/uinput

Changed in python-uinput:
status: New → Incomplete
assignee: nobody → Tuomas Jorma Juhani Räsänen (tuomasjjrasanen)
Revision history for this message
Sarah Van Bogaert (svbg) wrote :

This is the answer I get:
device path not found

It may help you to know that I hadn't installed libudev-dev the first time I installed the source code. After I finally installed libudev-dev, I installed python-uinput a second time to be sure.

Revision history for this message
a (tuomasjjrasanen) wrote :

Hmm.. then it might be that you don't have the necessary uinput kernel module in your system.

Could you please run following commands, in this order:

1. grep uinput /proc/modules

What does it print?

2. su -c 'modprobe -i uinput' && grep uinput /proc/modules

What does it print?

Thanks in advance!

Revision history for this message
Sarah Van Bogaert (svbg) wrote :

The first command gives nothing back:
$ grep uinput /proc/modules

When I run the second, I get:
$ su -c 'modprobe -i uinput' && grep uinput /proc/modules
uinput 4796 0 - Live 0xf7c7d000

Revision history for this message
a (tuomasjjrasanen) wrote :

Perfect!

So the root cause is that the uinput module was not loaded. `modprobe uinput' loads the kernel module.

After running 'modprobe uinput', also python-uinput should be working. To load uinput module automatically after boot, add uinput to /etc/modules::

su -c 'echo uinput >> /etc/modules'

I'll fix the .deb package to include this fix in future releases.

Changed in python-uinput:
status: Incomplete → In Progress
importance: Undecided → Medium
Revision history for this message
Sarah Van Bogaert (svbg) wrote :

That was it, it works now :-)

Thanks a lot!

Revision history for this message
a (tuomasjjrasanen) wrote :

I'm not providing pre-built binaries anymore, but the modprobing uinput is now mentioned in documentation.

Changed in python-uinput:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.