AppImage requires python 3.8.
Trying the appimage on my gentoo system that only has python 3.11.
Traceback (most recent call last):
File "/tmp/.mount_TwitchSAXRx5/usr/src/main.py", line 26, in <module>
from twitch import Twitch
File "/tmp/.mount_TwitchSAXRx5/usr/src/twitch.py", line 38, in <module>
from gui import GUIManager
File "/tmp/.mount_TwitchSAXRx5/usr/src/gui.py", line 21, in <module>
import pystray
File "/tmp/.mount_TwitchSAXRx5/usr/lib/python3.8/site-packages/pystray/__init__.py", line 64, in <module>
Icon = backend().Icon
File "/tmp/.mount_TwitchSAXRx5/usr/lib/python3.8/site-packages/pystray/__init__.py", line 56, in backend
return candidate()
File "/tmp/.mount_TwitchSAXRx5/usr/lib/python3.8/site-packages/pystray/__init__.py", line 28, in appindicator
from . import _appindicator as backend; return backend
File "/tmp/.mount_TwitchSAXRx5/usr/lib/python3.8/site-packages/pystray/_appindicator.py", line 20, in <module>
gi.require_version('Gtk', '3.0')
File "/tmp/.mount_TwitchSAXRx5/usr/lib/python3.8/site-packages/gi/__init__.py", line 126, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available
I have not tried the other type, PyInstaller.
I did manage to get it running by using hints in another bug to run the git version and had to use PYSTRAY_BACKEND=gtk
Is it possible to package all the python depends in AppImage so it can run on any linux system?
The AppImage does not require Python 3.8 to be installed on the system, because Python is already included within the AppImage.
You can verify this by extracting the AppImage:
$ ./TwitchDropsMiner*.AppImage --appimage-extract
You'll find the Python executable (python3.8) in squashfs-root/usr/bin.
I'm not really sure why you're getting that error, but I've been using the AppImage on Arch Linux (and I've tested it on Ubuntu 20.04), with no issues...
Perhaps give the PyInstaller package a try.
I did manage to get it running by using hints in another bug to run the git version and had to use PYSTRAY_BACKEND=gtk
With the GTK backend you'll get a blurry tray icon (if you care about that kind of stuff).
If you just install the libappindicator-gtk3 package (or whatever it's called on Gentoo), you should have no errors.
I'm assuming this one is solved by now.
This issue is still plaguing both the AppImage and the Pyinstall on Gentoo.
If using the AppImage you receive "Namespace gtk not available" If using the pyinstall you receive "Namespace DBus not available"
I've attempted to install dev-libs/libappindicator, and it does not solve the problem. However given gentoo is commonly run on OpenRC rather than systemd, I'm guessing that this is where the error actually originates. Especially given the pyinstaller DBus response. All this being said the wine functions well enough, sorry for necro.
So, if I understand correctly, you do not have DBus installed? If that's the case, I'm not sure the systray can work without it...
As a last resort, you could try any of the other backends supported by pystray:
https://pystray.readthedocs.io/en/latest/usage.html#selecting-a-backend
If that also doesn't work, then I'm out of ideas.
Ah, okay a bit more digging leads me here, DBus is installed, however for some reason Drops Miner fails to call to the existing services. I'd assume that workaround won't work cause it's less the idea that they're not there, just that it fails to interface. Hasn't been an issue with AppImages before but gentoo can be finicky. Running "busctl --user tree" Shows me a list of the existing buses, which include GTK and more, the list is rather long and likely not helpful. I'm far from an expert here just offering up what I'm observing. No worries if it can't be fixed, as stated the wine version works well enough.
If this is related solely to the tray icon support, it could be a good idea to report this under the Pystray repo: https://github.com/moses-palmer/pystray
You'd need a good repro code for it though. I can write up something simple for you to test, if you'd like to go this route. Or you can write it yourself if you know how to. Or you can just link this project as reference. Up to you, really.
I'm unsure if it's gnome related as well, as the latest gnome attempts to stop using the tray. If you'd like to, I'd gladly test it and bridge it to the pystray repo.