savbell / whisper-writer

šŸ’¬šŸ“ A small dictation app using OpenAI's Whisper speech recognition model.
GNU General Public License v3.0
244 stars 40 forks source link

nixkeyboard.py: You must be root to use this library on linux... #39

Closed faspie closed 1 month ago

faspie commented 2 months ago

I tried to install whisper-writer on Ubuntu jammy

Requirements could only be satisfied by removing fixed version for "av" and "faster-whisper" in requirements.txt

Startup now fails

Traceback (most recent call last): File "/home/fabian/whisper-writer/src/main.py", line 136, in <module> keyboard.add_hotkey(config['activation_key'], on_shortcut) File "/home/fabian/whisper-writer/venv/lib/python3.10/site-packages/keyboard/__init__.py", line 639, in add_hotkey _listener.start_if_necessary() File "/home/fabian/whisper-writer/venv/lib/python3.10/site-packages/keyboard/_generic.py", line 35, in start_if_necessary self.init() File "/home/fabian/whisper-writer/venv/lib/python3.10/site-packages/keyboard/__init__.py", line 196, in init _os_keyboard.init() File "/home/fabian/whisper-writer/venv/lib/python3.10/site-packages/keyboard/_nixkeyboard.py", line 113, in init build_device() File "/home/fabian/whisper-writer/venv/lib/python3.10/site-packages/keyboard/_nixkeyboard.py", line 109, in build_device ensure_root() File "/home/fabian/whisper-writer/venv/lib/python3.10/site-packages/keyboard/_nixcommon.py", line 174, in ensure_root raise ImportError('You must be root to use this library on linux.') ImportError: You must be root to use this library on linux.

savbell commented 1 month ago

Hi, thanks for the bug report! I've just released a major rewrite of the application which removed dependency on the keyboard package. This should solve the issue.

Something else I noticed is that you are running the application using Python 3.10. I would recommend using Python 3.11, since that is the version the app was written for. I do not know if all the packages are compatible with Python 3.10, so you may run into more issues there.

Cheers, Sav