Title: PermissionError: [Errno 13] Failed to open the uinput device: Permission denied · Issue #9 · pyinput/python-uinput · GitHub
Open Graph Title: PermissionError: [Errno 13] Failed to open the uinput device: Permission denied · Issue #9 · pyinput/python-uinput
X Title: PermissionError: [Errno 13] Failed to open the uinput device: Permission denied · Issue #9 · pyinput/python-uinput
Description: I am trying to use uinput as a standard user, as for my intended usage this is how most people will want to use it. I have installed uinput into a python venv using pip install python-uinput I have run chmod a=rw /dev/input as root (comm...
Open Graph Description: I am trying to use uinput as a standard user, as for my intended usage this is how most people will want to use it. I have installed uinput into a python venv using pip install python-uinput I have...
X Description: I am trying to use uinput as a standard user, as for my intended usage this is how most people will want to use it. I have installed uinput into a python venv using pip install python-uinput I have...
Opengraph URL: https://github.com/pyinput/python-uinput/issues/9
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PermissionError: [Errno 13] Failed to open the uinput device: Permission denied","articleBody":"I am trying to use uinput as a standard user, as for my intended usage this is how most people will want to use it.\n\n- I have installed uinput into a python venv using `pip install python-uinput`\n- I have run `chmod a=rw /dev/input` as root (comment from issue #3)\n- I have run `/usr/sbin/modprobe -i uinput` as the standard user\n- I have confirmed the module is loaded with `lsmod | grep uinput`, I got: `uinput 20480 0`\n\nI used the mouse example:\n```\nimport uinput\n\nwith uinput.Device([uinput.REL_X, uinput.REL_Y, uinput.BTN_LEFT, uinput.BTN_RIGHT]) as device:\n for i in range(20):\n device.emit(uinput.REL_X, 5)\n device.emit(uinput.REL_Y, 5)\n```\n\nwhen running this I get:\n```\nTraceback (most recent call last):\n File \"/home/dave/Documents/github/robotframework-dbus/tmp/uinput_mouse.py\", line 3, in \u003cmodule\u003e\n with uinput.Device([uinput.REL_X, uinput.REL_Y, uinput.BTN_LEFT, uinput.BTN_RIGHT]) as device:\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/home/dave/Documents/github/robotframework-dbus/.venv/lib/python3.11/site-packages/uinput/__init__.py\", line 190, in __init__\n self.__uinput_fd = fd or fdopen()\n ^^^^^^^^\n File \"/home/dave/Documents/github/robotframework-dbus/.venv/lib/python3.11/site-packages/uinput/__init__.py\", line 88, in fdopen\n return _libsuinput.suinput_open()\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/home/dave/Documents/github/robotframework-dbus/.venv/lib/python3.11/site-packages/uinput/__init__.py\", line 74, in _open_error_handler\n raise OSError(code, msg)\nPermissionError: [Errno 13] Failed to open the uinput device: Permission denied\n```\n\nI tried to check dmesg (also based on comment from Issue #3) but current user is not able to access dmesg (dmesg: read kernel buffer failed: Operation not permitted), I when I checked dmesg as root it on;y shows messages from when I tried to run the same example as root, which also did not move the mouse on the desktop of the current logged in user (not surprising I guess)\n\nI'm not sure how to proceed from here? Any advice? does uinput-python work for non-privileged users?\n\n\nedit:\n- Debian 12 (bookworm) 64bit\n- Gnome 43.9\n- Wayland (This is why I'm looking into uinput-python, pyautogui doesn't work with Wayland) \n\nDave.","author":{"url":"https://github.com/damies13","@type":"Person","name":"damies13"},"datePublished":"2025-07-11T07:35:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/9/python-uinput/issues/9"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:64078ced-d46e-6989-f746-beff2dd70a5c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA4A:5E6E6:9A3DB1:D410A5:698F2CDC |
| html-safe-nonce | 0f9a06203908da383d1b1a2026f0e3b74b14ed2bb43264f6b5e4b8d98470c82d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTRBOjVFNkU2OjlBM0RCMTpENDEwQTU6Njk4RjJDREMiLCJ2aXNpdG9yX2lkIjoiNzcwMjk3NjU3MjQ0MTk2Mzc0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2764cdd909d66012c2c5a4bc068c8ab4baa8ab32a79dc41201c823e40b8156c7 |
| hovercard-subject-tag | issue:3221902361 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pyinput/python-uinput/9/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0713ad848b76d495e2670cba5eaaa474f689689cee8126f5eded76bf6a05bf88/pyinput/python-uinput/issues/9 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0713ad848b76d495e2670cba5eaaa474f689689cee8126f5eded76bf6a05bf88/pyinput/python-uinput/issues/9 |
| og:image:alt | I am trying to use uinput as a standard user, as for my intended usage this is how most people will want to use it. I have installed uinput into a python venv using pip install python-uinput I have... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | damies13 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6102991c714c1a6a27d05fb4f96ea6ca87a6750b4f093b95cc57ed1b84b145a1 |
| turbo-cache-control | no-preview |
| go-import | github.com/pyinput/python-uinput git https://github.com/pyinput/python-uinput.git |
| octolytics-dimension-user_id | 158596880 |
| octolytics-dimension-user_login | pyinput |
| octolytics-dimension-repository_id | 773191892 |
| octolytics-dimension-repository_nwo | pyinput/python-uinput |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 773191892 |
| octolytics-dimension-repository_network_root_nwo | pyinput/python-uinput |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d52a41ad9b9ffb9b63a1b4a600a6054be8b70b36 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width