Bugzilla – Bug 2930
pygoocanvas package missing in Ubuntu 18.04
Last modified: 2018-08-15 16:50:56 EDT
python-pygoocanvas is a dependency of pyviz but has been unmaintained since 2010, and in Ubuntu 18.04, the package was dropped. Other solutions should be tested and documented for Ubuntu 18.04, such as possibly installing from another PPA or pip, or else building from source.
Longer term, porting pyviz to some other package would help.
As far as I understand, GooCanvas itself is no more actively developed.
However, GooCanvas (https://github.com/GNOME/goocanvas) seems to have Python bindings.
Perhaps, a good option could be a simple forward-port to "plain" GooCanvas.
I seem to remember sending somewhere (maybe privately to Tom?) a patch porting from pygoocanvas to pygobject 3.0 based bindings (which work with a system called GObject Introspection, so there are no python bindings specific for GooCanvas, they're not needed anymore).
Ah, there it is... Tom, can you search for "State of ns3 in the Debian distribution" emails? I sent a hg bundle with my latest work on this. Can't promise it to be 100% bug free, but it seemed to mostly work, last I checked.
I'll attach the bundle here so it doesn't get lost.
Created attachment 3116 [details]
pyviz update bundle
I applied and tested Gustavo's patches and they nearly work, but a lingering issue is that one of the plugins depends on python-kiwi which does not appear to be compatible with GTK3+.
The plugin is src/visualizer/visualizer/plugins/show_last_packets.py.
One possibility is to change the plugin to avoid the dependency.
I established a testing branch with these patches at:
For Mint 19/Ubuntu 18.04, I installed the following prerequisites:
python-gi python-gi-cairo python-pygraphviz python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython ipython3
Ankit said that he would take a look at it.
I made some progress on debugging this.
First, the required list of packages (Mint 19/Ubuntu 18.04) is:
gir1.2-goocanvas-2.0 python-gi python-gi-cairo python-pygraphviz python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython ipython3
My tree is at: https://gitlab.com/tomhenderson/ns-3-dev/tree/gtk3
There is a dependency on python-kiwi in the show_last_packets.py plugin, but this plugin seems to be nowhere used, so I think we can ignore it for the moment.
I am able to get this to run successfully except for one feature:
$ ./waf --pyrun src/flow-monitor/examples/wifi-olsr-flowmon.py --vis
The one missing feature is that the flow labels do not show up with the arrows that show flow activity.
The code that is doing this is in core.py, around line 1300.
If I make this change (to lower the visibility threshold):
diff --git a/src/visualizer/visualizer/core.py b/src/visualizer/visualizer/core.py
index 6cc61b9e9..4cd4480e6 100644
@@ -1308,7 +1308,7 @@ class Visualizer(GObject.GObject):
kbps = float(rx_bytes*8)/1e3/rx_count/self.sample_period
font=("Sans Serif %f" % int(1+BITRATE_FONT_SIZE*k)))
angle = math.atan2((pos2_y - pos1_y), (pos2_x - pos1_x))
if -PI_OVER_2 <= angle <= PI_OVER_2:
Then the labels appear. However, they are all overlaid on a single spot-- the code to align each label with its respective arrow is not working yet.
Added Gustavo's latest patch to my gitlab branch; works for Ubuntu 18.04/Mint 19.
There is an upstream bug in PyGObject that prevents the flow labels from being rendered vertically: https://gitlab.gnome.org/GNOME/pygobject/issues/16
Gustavo committed a workaround on it.
On Fedora 26, I am seeing this error:
core.py", line 419, in set_position
bounds = self.visualizer.canvas.get_bounds()
TypeError: GooCanvas.Canvas.get_bounds() takes exactly 5 arguments (1 given)
patches committed in changesets 13738 through 13743, and open issues are moved to separate issues (2969-2972).