BoukeHaarsma23 / WattmanGTK

A Wattman-like GTK3+ GUI
GNU General Public License v2.0
374 stars 61 forks source link

Does not start, possible missing GTK+ dependencies? #39

Closed c-stauffer closed 5 years ago

c-stauffer commented 5 years ago

I'm on OpenSUSE Tumbleweed, using KDE. I would not be surprised if this error is caused by not having all the proper GTK+/GDK dependcies but I am much more familiar with Qt than GTK and do not know the best way to proceed (if that is indeed the case, maybe some documentation additions would be in order). Here is the output when running wattmanGTK:

$ sudo wattmanGTK                             
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

(wattmanGTK:27706): Gdk-CRITICAL **: 17:05:18.949: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/matplotlib-3.0.2-py3.6-linux-x86_64.egg/matplotlib/backends/backend_gtk3.py", line 28, in <module>
    cursors.MOVE          : Gdk.Cursor.new(Gdk.CursorType.FLEUR),
TypeError: constructor returned NULL

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/wattmanGTK", line 11, in <module>
    load_entry_point('WattmanGTK==0.0.1', 'console_scripts', 'wattmanGTK')()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2725, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2343, in load
    return self.resolve()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2349, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.6/site-packages/WattmanGTK-0.0.1-py3.6.egg/WattmanGTK/wattman.py", line 15, in <module>
    from WattmanGTK.handler import Handler # handles GUI
  File "/usr/lib/python3.6/site-packages/WattmanGTK-0.0.1-py3.6.egg/WattmanGTK/handler.py", line 22, in <module>
    from WattmanGTK.plot import Plot
  File "/usr/lib/python3.6/site-packages/WattmanGTK-0.0.1-py3.6.egg/WattmanGTK/plot.py", line 20, in <module>
    from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo as FigureCanvas # required for GTK3 integration
  File "/usr/lib/python3.6/site-packages/matplotlib-3.0.2-py3.6-linux-x86_64.egg/matplotlib/backends/backend_gtk3cairo.py", line 1, in <module>
    from . import backend_cairo, backend_gtk3
  File "/usr/lib/python3.6/site-packages/matplotlib-3.0.2-py3.6-linux-x86_64.egg/matplotlib/backends/backend_gtk3.py", line 37, in <module>
    raise ImportError(exc)
ImportError: constructor returned NULL
BoukeHaarsma23 commented 5 years ago

Yeah you need python3-cairo I think

BoukeHaarsma23 commented 5 years ago

So here: https://software.opensuse.org/package/python-cairo If you continue having issues let me know. I will close this for now

c-stauffer commented 5 years ago

I already had the python-cairo package installed (both python2 and 3 versions). I will keep digging to see if I can find a decent solution for non-GTK users that isn't simply "lol just install GNOME" (although that may end up to be the simplest path).

I am going to keep this closed, but if I find anything worth sharing, I'll share.

BoukeHaarsma23 commented 5 years ago

I've seen somethings in the wild with WattmanGTK on KDE. Here is an older version running: https://imgur.com/bdowsSL

So it should not be impossible

File "/usr/lib/python3.6/site-packages/matplotlib-3.0.2-py3.6-linux-x86_64.egg/matplotlib/backends/backend_gtk3cairo.py", line 1, in from . import backend_cairo, backend_gtk3

suggests to me that it is not installed. You could also try installing it via pip

parkerlreed commented 5 years ago

@c-stauffer It works for me in both non-root and root with Plasma 5.14 in Arch.

Here's my package list of everything involved.

wattman-gtk-git r168.de6ae35-1 python-cairo 1.17.0-2 python-gobject 3.30.1-3 python-matplotlib 3.0.1-1 python 3.7.1-1

2018-11-12_18-33

Also do you get the same error without sudo?

c-stauffer commented 5 years ago

File "/usr/lib/python3.6/site-packages/matplotlib-3.0.2-py3.6-linux-x86_64.egg/matplotlib/backends/backend_gtk3cairo.py", line 1, in from . import backend_cairo, backend_gtk3

suggests to me that it is not installed. You could also try installing it via pip

My backends directory did contain a backend_gtk3.py, _gtk3_compat.py, and backend_cairo.py. After taking a look at the package list posted by @parkerlreed, I found that I did not have python3-matplotlib (matplotlib was indeed installed, but with pip rather than my distribution's package manager). In fact all of the packages were there from me installing them via pip, but that seems to not work well, and so I had to re-install the versions from my package manager. This got me a bit further, until it complained about not finding backend_gtk3cairo.py. After installing the python3-matplotlib-cairo and python3-matplotlib-gtk3 packages, I now longer get any ModuleNotFound errors, but it is still failing on the same line as it was initially.

Also do you get the same error without sudo?

Errors on amd_pci_ids = subprocess.check_output("lspci | grep -E \"^.*VGA.*[AMD/ATI].*$\" | grep -Eo \"^([0-9a-fA-F]+:[0-9a-fA-F]+.[0-9a-fA-F])\"", shell=True).decode().split(), as lspci is in /usr/sbin. Running just that inner part as root works.

This isn't the first issue I've had with the way OpenSUSE packages things. The install script for dotnet Core works for every distribution except for OpenSUSE, because it named a few libraries differently than everyone else.

elsandosgrande commented 5 years ago

OS: Gentoo (amd64/17.0/systemd/desktop/plasma profile)

So, when running run.py, I'm having the same issue (setup.py failed in a different way). I've checked and I have both pycairo (Python bindings for the cairo library) and matplotlib (Pure python plotting library with matlab like syntax) installed.