timothycrosley / streamdeck-ui

A Linux compatible UI for the Elgato Stream Deck.

Home Page:https://timothycrosley.github.io/streamdeck-ui/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fedora 38 Install not able to launch application

Narcodepsy opened this issue · comments

Describe the bug
Application wont launch when installed on Fedora 38 following the guide.

To Reproduce
Steps to reproduce the behaviour:

  1. Fresh install of Fedora 38 workstation (both baremetal and VM)
  2. Install kernel-headers
  3. Follow "installing on fedora guide"
  4. when trying to launch
  5. Review console output
  6. See error

Traceback (most recent call last): File "/home/stephen/.local/bin/streamdeck", line 5, in <module> from streamdeck_ui.gui import start File "/home/stephen/.local/lib/python3.11/site-packages/streamdeck_ui/gui.py", line 17, in <module> from streamdeck_ui.api import StreamDeckServer File "/home/stephen/.local/lib/python3.11/site-packages/streamdeck_ui/api.py", line 8, in <module> from PIL.ImageQt import ImageQt ModuleNotFoundError: No module named 'PIL.ImageQt'

Expected behaviour
Launch Streamdeck-ui

Operating system (please complete the following information)

  • OS: Fedora 38 Workstation
  • Desktop environment: GNOME
  • Python version Python 3.11.3

Stream Deck Version
Across the board as software issue.
Can do any tests on Standard MK.2

Happy to help replication try different methods on bare metal and VM.

commented

Same error here. I tried to do pip install Pillow but it still does give the error.

Installing python3-pillow-qt will get past that error.

The next error I get is

streamdeck 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, wayland-egl, wayland, xcb.

Aborted (core dumped)

Same error here, but unlike @parkervcp when I try to install python3-pillow-pip, get this error:

ERROR: Could not find a version that satisfies the requirement python3-pillow-qt (from versions: none)
ERROR: No matching distribution found for python3-pillow-qt

Avoid pip dependencies like the plague. Whenever there's a Python package you need to install as a dependency for something, look first for something officially packed by the Fedora maintainers with dnf search <something> and looking for the python3- prefixed packages. Running pip in Fedora as root is just like summoning a daemon from the worst pit on hell (I really hope you haven't done it).

The alternative are virtualenvs, but then you need to understand it well in order to interact with native C/C++ libs like Qt/X11.

I have this system since Fedora 26, so I probably have extra packages installed that are not needed/related at all by streamdeck-ui, but here is is a dump of relevant packages I have installed in my FC38 system. That is with streamdeck-ui working both with the latest stable release per official install instructions and with the latest commit as of right now built with poetry (one of the many variants of creating and managing virtualenvs):

$ rpm -qa | grep -i pillow
python3-pillow-9.4.0-2.fc38.x86_64
python3-pillow-tk-9.4.0-2.fc38.x86_64

$ rpm -qa | grep -i xcb
libX11-xcb-1.8.4-1.fc38.x86_64
libxcb-1.13.1-11.fc38.x86_64
xcb-util-keysyms-0.4.1-2.fc38.x86_64
xcb-util-0.4.1-2.fc38.x86_64
xcb-util-image-0.4.1-2.fc38.x86_64
xcb-util-renderutil-0.3.10-2.fc38.x86_64
xcb-util-wm-0.4.2-2.fc38.x86_64
xcb-util-cursor-0.1.4-2.fc38.x86_64
libxcb-devel-1.13.1-11.fc38.x86_64
libX11-xcb-1.8.4-1.fc38.i686
libxcb-1.13.1-11.fc38.i686

My guess is that the following could solve your issues:

pip uninstall Pillow
sudo dnf install python3-pillow libX11-xcb libxcb{,-devel}

I'm probably installing too many packages there being pulled as dependencies of libxcb-devel, but I believe you will be covered by this.

Ah, I had Stream Deck Classic V2 working with the stable release and now with the latest commit I have Pedal working too.

    from PIL.ImageQt import ImageQt
ModuleNotFoundError: No module named 'PIL'

Let's start from scratch, there's too little information to help you here:

How are you invoking it? What's the environment content? Did you do something else so far? Do you have pyenv, pipfile, virtualenv, poetry or some other tool isolating things? Which folder are you in? How did you download the code?

And did you close the terminal and opened a new one after making those changes? What is your python interpreter and root?

If you need help determining those things, tell us. We are not sure if it's your first contact with Python and you need extra help or if you can just be pointed to the right direction and can figure things out for yourself. In either case, more info is always better. :)

Let's start from scratch, there's too little information to help you here:

How are you invoking it? What's the environment content? Did you do something else so far? Do you have pyenv, pipfile, virtualenv, poetry or some other tool isolating things? Which folder are you in? How did you download the code?

And did you close the terminal and opened a new one after making those changes? What is your python interpreter and root?

If you need help determining those things, tell us. We are not sure if it's your first contact with Python and you need extra help or if you can just be pointed to the right direction and can figure things out for yourself. In either case, more info is always better. :)

yeah also tried restarting computer after making the changes. python version 3.11. root will be the default.
It was a fresh install of fedora when i followed the guide. did not install anything else prior to trying was a totally fresh instal only dnf update and upgade ran.

Happy to run any commands etc that will help troubleshoot.

launching it from terminal.

Awesome, then I think it will be easier to actually follow the developer's way and build it yourself. There are a few commits in the main branch that haven't made into a release just yet but are playing much nicer with Fedora 38. Since you don't have other environment manager you would like to consolidate stuff, let's do poetry. :)

The first issue is that we don't install Python packages in general outside a virtual environment except when it is already packaged by the distro and guaranteed to play nice with all other packages of said distro. The Fedora team ensures there's no dependency conflicts when you install Python packages via DNF from the official Fedora repos. The issue is, as you might imagine, that this does not always satisfy the version needs of Python packages that were not packaged by Fedora, like any random FOSS project on Github. Or they might, but not all the time. So, we try to isolate things. There's a myriad of tools to do that.

The very first thing you have is pip: it reads the requirements.txt file, try to solve dependencies and install packages in the default system folder, default user folder (if invoked with --user), or any other folder you specify from the Pypi repository. It doesn't have any notion of what distro it is running on or which package it is responsible for and which the system is.

To solve this, there are a few solutions: the base of most others is virtualenv, which only change the place where you download the packages, some other tools help you keep multiple versions of the Python interpreter (like pyenv) either by downloading the source and building or getting the binary from somewhere else, and some unite the capabilities of the previous two (like pipenv). You can use any of these if you are willing enough.

This project prefers poetry (although nothing prevents from using any of the others). It manages the package lifecycle from start to finish, even publishing the package for you. The only thing that's still a pain with it is when you need to bind to external C/C++ dynamic libraries. It can help you with that, but the developer normally needs to instruct it how to deal with each OS+version combination. That includes Linux distros, OSX and even Windows. Luckily this project has everything figured out for F38 as of now.

Enough talk, let's do it:

sudo dnf install poetry
git clone https://github.com/timothycrosley/streamdeck-ui.git
cd streamdeck-ui
poetry install
poetry run streamdeck

This should launch the application after building the Qt bits. Making it run during login will need some modifications from the official instructions, but one thing at a time. Let's see if I did not forget any other dependency first.

Any error you get, post the greatest amount of info you can. Paste the output of the whole command execution if you can, preferably even with the commands before it. Use https://gist.github.com to send big blobs of text and paste the link you get after uploading.

thank you greatly.
I have been most recently exploring docker and containerising so i like the idea of poetry. So i will read into that some more.

Not touched python for a good few years!

That ran fine, and from a quick fiddle works as it did previously on Manjaro from running that command.
One error in terminal window as below when run "poetry run streamdeck" all other commands had no errors:
qt.core.qobject.connect: QObject::connect: No such signal QPlatformNativeInterface::systemTrayWindowChanged(QScreen*)

It thinks it is an original steamdeck not a mk2 but i imagine this is just naming and not having any real impact.

Great!

What you're missing is the icon at the system tray. Gnome abolished that because that was becoming a gigantic mess, but they're now working on bringing it back in a standardized way.

In the meanwhile, there's an extension to emulate the previous behavior:

sudo flatpak install org.gnome.Extensions

Then install the AppIndicatorSupport extension for gnome-shell, enable it and restart streamdeck. You may need to kill it:

kill -9 $(ps -ef | grep pypoetry/virtualenvs/streamdeck | awk '{print $2}' | head -n1)

Regarding Docker/Moby/Podman/Containerd/Rkt/CRI-O/LXD and friends, containerization would be a great tool for this if this weren't an app supposed to interact with X11 or Wayland. Containerization is awesome to isolate dependencies and communications, but the very thing you need is IPC (Inter-Process Communication) for window drawing, input injection, system tray interaction, direct USB access and all that.

It would have been slightly easier in the past when all you needed was X11 since it has a server-client model (over the network if desired), but today even if you're running in X11 mode you're already using a number of parts from the Wayland effort, which were specifically designed to not have the same constraints regarding performance and integration hurdles that the original X11 project had.

It's not impossible to containerize this, but from someone which works professionally with containerization since 2013, believe me when I say that it would be a hell of a pain in the butt, and without the isolation benefits that you would usually want from a container.

When trying to install AppIndicatorSupport extension, have to install sudo dnf install gnome-browser-connector .
Have started gnome-browser-connector

Then the top of the webpage you linked, displays error "No such native application org.gnome.chrome_gnome_shell" (via firefox)

Ah, gnome-extensions leaves a process listening in the DBus, probably isn't running yet. You can restart your session or you can download the zip (Gnome 44 and extension version 53 currently) and then install it with:

gnome-extensions install Downloads/appindicatorsupportrgcjonas.gmail.com.v53.shell-extension.zip

EDIT: Sorry, the extension version is 53, not 47.

Don't worry about updates. The zip has a manifest with its version and an unique ID in the gnome-extensions registry where the flatpak you just installed occasionally checks if there's a new version, prompting you if you want to install it, specially if you just updated gnome and the currently installed version of the extension is not stated to be compatible with it.

appindicatorsupport@rgcjonas.gmail.com exists and --force was not specified

(sorry if this is obvious) appreciate the help.

If it is not getting in, it's because you're not putting enough force. :)

This will update the extension if it is not the latest one anyway. After that you need to open gnome-extensions and enable it.

We have no errors and the GUI,streamdeck is running!

The systemd service file then becomes something like the file below. Replace the path where your copy of the repository is, with %h being your home (environment variables don't work there because these files are evaluated really early in the boot or login session).

File: $HOME/.config/systemd/user/streamdeck.service (create the folders in the middle if they don't exist yet)

[Unit]
Description=A Linux compatible UI for the Elgato Stream Deck.

[Service]
Type=simple
Restart=on-failure
KillMode=process
TimeoutSec=5

WorkingDirectory=%h/oss/streamdeck-ui
ExecStart=/usr/bin/poetry run streamdeck -n

[Install]
WantedBy=default.target

Then systemctl --user daemon reload and systemctl --user enable --now streamdeck.

Running with poetry works for me but I am on cinnamon 5.6.8 so installing gnome-extensions is not a productive move for me, I am still looking at what packages I need to resolve the missing platform plugins.

I get the following when trying to start streamdeck-ui right now via console.

[parker@estel streamdeck-ui]$ streamdeck 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, wayland-egl, wayland, xcb.

Aborted (core dumped)

The systemd service file then becomes something like the file below. Replace the path where your copy of the repository is, with %h being your home (environment variables don't work there because these files are evaluated really early in the boot or login session).

File: $HOME/.config/systemd/user/streamdeck.service (create the folders in the middle if they don't exist yet)

[Unit]
Description=A Linux compatible UI for the Elgato Stream Deck.

[Service]
Type=simple
Restart=on-failure
KillMode=process
TimeoutSec=5

WorkingDirectory=%h/oss/streamdeck-ui
ExecStart=/usr/bin/poetry run streamdeck -n

[Install]
WantedBy=default.target

Then systemctl --user daemon reload and systemctl --user enable --now streamdeck.

Thanks for the help, managed to finish off today and working as expected. key press and type text does not always work but this is highlighted in the main github page as being known for fedora.

hi, this project seems to be stale and a new fork as been made with the intention of replacing this one.

if this still an issue please reopen it at: https://github.com/streamdeck-linux-gui/streamdeck-linux-gui