You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to run emailproxy on a "headless" Linux VM (Ubuntu Server)
It seems even with --no-gui, it tries to load Gtk:
python emailproxy.py --no-gui --local-server-auth
Traceback (most recent call last):
File "emailproxy.py", line 39, in
import pystray
File "/usr/local/lib/python3.8/dist-packages/pystray/init.py", line 64, in
Icon = backend().Icon
File "/usr/local/lib/python3.8/dist-packages/pystray/init.py", line 56, in backend
return candidate()
File "/usr/local/lib/python3.8/dist-packages/pystray/init.py", line 28, in appindicator
from . import _appindicator as backend; return backend
File "/usr/local/lib/python3.8/dist-packages/pystray/_appindicator.py", line 19, in
gi.require_version('Gtk', '3.0')
File "/usr/lib/python3/dist-packages/gi/init.py", line 129, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available
My "quick and dirty" solution:
I moved the "import pystray" to the "else" part of "if self.args.no_gui" around line 1515.
I have not tested if this now works with gui-enabled installations.
And for a proper solution, you might want to look if there is a better placement, or if other libraries are needed to be handled similar as well?
Best regards,
Marco
The text was updated successfully, but these errors were encountered:
The proxy was primarily designed for use with a GUI, so while the sort of change you propose does indeed work, I currently prefer the route suggested in the readme, which points to this previous discussion. Essentially, you set an environment variable to direct pystray not to try loading any GUI toolkit. If that doesn't work I'd be happy to look at alternatives, but for now I think it's the best way to go.
Hi!
I am trying to run emailproxy on a "headless" Linux VM (Ubuntu Server)
It seems even with --no-gui, it tries to load Gtk:
python emailproxy.py --no-gui --local-server-auth
Traceback (most recent call last):
File "emailproxy.py", line 39, in
import pystray
File "/usr/local/lib/python3.8/dist-packages/pystray/init.py", line 64, in
Icon = backend().Icon
File "/usr/local/lib/python3.8/dist-packages/pystray/init.py", line 56, in backend
return candidate()
File "/usr/local/lib/python3.8/dist-packages/pystray/init.py", line 28, in appindicator
from . import _appindicator as backend; return backend
File "/usr/local/lib/python3.8/dist-packages/pystray/_appindicator.py", line 19, in
gi.require_version('Gtk', '3.0')
File "/usr/lib/python3/dist-packages/gi/init.py", line 129, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available
My "quick and dirty" solution:
I moved the "import pystray" to the "else" part of "if self.args.no_gui" around line 1515.
I have not tested if this now works with gui-enabled installations.
And for a proper solution, you might want to look if there is a better placement, or if other libraries are needed to be handled similar as well?
Best regards,
Marco
The text was updated successfully, but these errors were encountered: