timothycrosley / streamdeck-ui

A Linux compatible UI for the Elgato Stream Deck.
https://timothycrosley.github.io/streamdeck-ui/
MIT License
1.12k stars 240 forks source link

Error - Streamdeck not launching - Fedora 37 #284

Closed ILvCookies closed 1 year ago

ILvCookies commented 1 year ago

Hi <('-'<), I have installed the streamdeck-ui successfully for Fedora 37. When trying to run it, the following error appears. I am not sure if this is a bug or just a bad configuration of my pc.

Command (without sudo): streamdeck

Error: Traceback (most recent call last): File "/home/asuka/.local/bin/streamdeck", line 5, in from streamdeck_ui.gui import start File "/home/asuka/.local/lib/python3.11/site-packages/streamdeck_ui/gui.py", line 20, in from streamdeck_ui import api File "/home/asuka/.local/lib/python3.11/site-packages/streamdeck_ui/api.py", line 11, in from pynput.keyboard import Controller, Key File "/home/asuka/.local/lib/python3.11/site-packages/pynput/init.py", line 40, in from . import keyboard File "/home/asuka/.local/lib/python3.11/site-packages/pynput/keyboard/init.py", line 31, in backend = backend(name) ^^^^^^^^^^^^^^^^^ File "/home/asuka/.local/lib/python3.11/site-packages/pynput/_util/init.py", line 76, in backend raise ImportError('this platform is not supported: {}'.format( ImportError: this platform is not supported: ('failed to acquire X connection: Can\'t connect to display ":0": b\'Authorization required, but no authorization protocol specified\n\'', DisplayConnectionError(':0', b'Authorization required, but no authorization protocol specified\n'))

Try one of the following resolutions:

Hope there is a fix, I love the project when I installed it on Fedora 36. ⸜(。˃ ᵕ ˂ )⸝ Thanks for the help. Regards.

katsadim commented 1 year ago

Switching from wayland to Xorg did the trick for me.

andersonid commented 1 year ago

I am X11 user and still having problems to install and launch the streamdeck-ui .

Traceback (most recent call last): File "/home/anobre/.local/bin/streamdeck", line 8, in sys.exit(start()) ^^^^^^^ File "/home/anobre/.local/lib/python3.11/site-packages/streamdeck_ui/gui.py", line 269, in start build_device(ui) File "/home/anobre/.local/lib/python3.11/site-packages/streamdeck_ui/gui.py", line 199, in build_device build_buttons(ui, page) File "/home/anobre/.local/lib/python3.11/site-packages/streamdeck_ui/gui.py", line 129, in build_buttons deck = api.get_deck(deck_id) ^^^^^^^^^^^^^^^^^^^^^ File "/home/anobre/.local/lib/python3.11/site-packages/streamdeck_ui/api.py", line 133, in get_deck return {"type": decks[deck_id].deck_type(), "layout": decks[deck_id].key_layout()}


KeyError: None
andersonid commented 1 year ago

I got the streamdeck-ui working using pipenv with python3.8
Still need to fix for use with system default python version (3.11).

bzeiss commented 1 year ago

I can confirm the KeyError: None issue for Fedora 37. Running Gnome on xorg.

novahazard commented 1 year ago

Is it a requirement to run xorg to get Streamdeck-ui to work on Fedora? It won't work on Wayland?

pblanton commented 1 year ago

How did you get it to install in the first place?

novahazard commented 1 year ago

I am having the same issue.

Traceback (most recent call last):
  File "/home/jb/.local/bin/streamdeck", line 8, in <module>
    sys.exit(start())
             ^^^^^^^
  File "/home/jb/.local/lib/python3.11/site-packages/streamdeck_ui/gui.py", line 269, in start
    build_device(ui)
  File "/home/jb/.local/lib/python3.11/site-packages/streamdeck_ui/gui.py", line 199, in build_device
    build_buttons(ui, page)
  File "/home/jb/.local/lib/python3.11/site-packages/streamdeck_ui/gui.py", line 129, in build_buttons
    deck = api.get_deck(deck_id)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/jb/.local/lib/python3.11/site-packages/streamdeck_ui/api.py", line 133, in get_deck
    return {"type": decks[deck_id].deck_type(), "layout": decks[deck_id].key_layout()}
                    ~~~~~^^^^^^^^^
KeyError: None

I am running Fedora 37. Error persists whether I am on Wayland or xorg. Because I had to install so many libraries, I can't (with 100% certainty) state the steps I took to install streamdeck-ui. I ran into pillow and hidapi issues similar to #277.

Any next steps recommended here?

pblanton commented 1 year ago

As for me, I also ran lots of library installs trying to get the installer to run on Fedora 37. It seems to me that this is the one that did the trick...

sudo dnf install python3-devel libusb1-devel libusbx-devel libudev-devel systemd-devel

I believe the libusb* libs here are the key.

Now that it is installed I can program the buttons but they don't do anything. Even the buttons that are programmed to switch pages on the device don't do anything. I still suspect a HID or USB library is either missing or ill-configured. I am still on X11, and haven't tried switching back to Wayland yet, but the consensus I've read is that it will not work on Wayland and it's a bit of a pain to switch them so until someone like Crosley tells me to give Wayland a try, I am going to wait and see what success others have.

Madwonk commented 1 year ago

tl;dr this is an upstream bug apparently and can be fixed by running xhost + before the UI

Consider the package in question: File "/usr/lib/python3/dist-packages/pynput/keyboard/__init__.py" is the pynput package, and not actually streamdeck-ui.

A cursory check of the upstream project finds this thread and solution, which works for me:

Run xhost + in the terminal, and it launches fine (at least on my machine). Supposedly it's a bug even further upstream in python-xlib, which I suspect is why upgrading packages might be working for some of you.

ebdavison commented 1 year ago

I am having the same error stated above with the comment from novahazard.

Fedora release 37 (Thirty Seven) NAME="Fedora Linux" VERSION="37 (Workstation Edition)" ID=fedora VERSION_ID=37 VERSION_CODENAME="" PLATFORM_ID="platform:f37" PRETTY_NAME="Fedora Linux 37 (Workstation Edition)" ANSI_COLOR="0;38;2;60;110;180" LOGO=fedora-logo-icon CPE_NAME="cpe:/o:fedoraproject:fedora:37" DEFAULT_HOSTNAME="fedora" HOME_URL="https://fedoraproject.org/" DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f37/system-administrators-guide/" SUPPORT_URL="https://ask.fedoraproject.org/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=37 REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=37 SUPPORT_END=2023-11-14 VARIANT="Workstation Edition" VARIANT_ID=workstation Fedora release 37 (Thirty Seven) Fedora release 37 (Thirty Seven)

ebdavison commented 1 year ago

I can confirm that python 3.9.16, in a virtual environment, works without any issues.

dotbanana commented 1 year ago

Same issue(s) here with Fedora 37 on Wayland

dodgyrabbit commented 1 year ago

See https://github.com/timothycrosley/streamdeck-ui/issues/293#issuecomment-1442785329

dodgyrabbit commented 1 year ago

A new version has been published (2.0.13) and tested from a clean Fedora 37 install. @novahazard you seem to have a different issue. Could you try the latest version and reopen a new case with details to reproduce and as much info as possible. Thanks!