Error when uploading graph-tool

(Gjuncosa) #1

Hello, I have successfully installed graph-tool in my Mac OS Mojave 10.14.2; however, when I try to imported I get an error about the libpango-1.0.0.dylib package. The error says “Reason: Incompatible library version: libpango-1.0.0.dylib requires version 5601.0.0 or later, but libgobject-2.0.0.dylib provides version 5501.0.0”
Does anybody know how I can upload this library or is this a compatibility issue in the graph-tool package itself? Attached you’ll find the code and the output I get. Thanks. G.

** CODE**

brew install graph-tool python
import sys
sys.path.append(’/usr/local/Cellar/graph-tool/2.27_6/lib/python3.7/site-packages/’)
from graph_tool.all import *

** Output **
from graph_tool.all import *

** (process:67651): WARNING **: 16:27:58.967: Failed to load shared library ‘/Users/gaby/anaconda3/lib/libpango-1.0.0.dylib’ referenced by the typelib: dlopen(/Users/gaby/anaconda3/lib/libpango-1.0.0.dylib, 9): Library not loaded: @rpath/libgobject-2.0.0.dylib
Referenced from: /Users/gaby/anaconda3/lib/libpango-1.0.0.dylib
Reason: Incompatible library version: libpango-1.0.0.dylib requires version 5601.0.0 or later, but libgobject-2.0.0.dylib provides version 5501.0.0
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/Cellar/graph-tool/2.27_6/lib/python3.7/site-packages/graph_tool/all.py”, line 35, in
from graph_tool.draw import *
File “/usr/local/Cellar/graph-tool/2.27_6/lib/python3.7/site-packages/graph_tool/draw/init.py”, line 875, in
from .cairo_draw import graph_draw, cairo_draw, get_hierarchy_control_points, default_cm
File “/usr/local/Cellar/graph-tool/2.27_6/lib/python3.7/site-packages/graph_tool/draw/cairo_draw.py”, line 1489, in
from gi.repository import Gtk, Gdk, GdkPixbuf
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 656, in _load_unlocked
File “”, line 626, in _load_backward_compatible
File “/Users/gaby/anaconda3/lib/python3.6/site-packages/gi/importer.py”, line 145, in load_module
importlib.import_module(‘gi.repository.’ + dep.split("-")[0])
File “/Users/gaby/anaconda3/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 656, in _load_unlocked
File “”, line 626, in _load_backward_compatible
File “/Users/gaby/anaconda3/lib/python3.6/site-packages/gi/importer.py”, line 145, in load_module
importlib.import_module(‘gi.repository.’ + dep.split("-")[0])
File “/Users/gaby/anaconda3/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 656, in _load_unlocked
File “”, line 626, in _load_backward_compatible
File “/Users/gaby/anaconda3/lib/python3.6/site-packages/gi/importer.py”, line 146, in load_module
dynamic_module = load_overrides(introspection_module)
File “/Users/gaby/anaconda3/lib/python3.6/site-packages/gi/overrides/init.py”, line 125, in load_overrides
override_mod = importlib.import_module(override_package_name)
File “/Users/gaby/anaconda3/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “/Users/gaby/anaconda3/lib/python3.6/site-packages/gi/overrides/Pango.py”, line 41, in
FontDescription = override(FontDescription)
File “/Users/gaby/anaconda3/lib/python3.6/site-packages/gi/overrides/init.py”, line 202, in override
assert g_type != TYPE_NONE
AssertionError

(Sean Molenaar) #2

You can probably just run brew upgrade to get the newer versions of your tools.

(Gjuncosa) #3

Great this worked. Thanks!

(Gjuncosa) #4

I have another question. With your suggestion I was able to import graph-tool, thank you by the way, however, I get an error message for Cairo package. This is what I get. I’ve used Homebrew to install cairo, however the program seems to expect to upload it directly from graph-tool. Thanks for the assistance.

(base) Gabrielas-MacBook-Air:hSBM gaby$ python ej.py

/usr/local/Cellar/graph-tool/2.27_6/lib/python3.7/site-packages/graph_tool/draw/cairo_draw.py:39: RuntimeWarning: Error importing cairo. Graph drawing will not work.

warnings.warn(msg, RuntimeWarning)

/usr/local/Cellar/graph-tool/2.27_6/lib/python3.7/site-packages/graph_tool/draw/cairo_draw.py:39: RuntimeWarning: Error importing cairo. Graph drawing will not work.

warnings.warn(msg, RuntimeWarning)

/usr/local/Cellar/graph-tool/2.27_6/lib/python3.7/site-packages/graph_tool/draw/cairo_draw.py:39: RuntimeWarning: Error importing cairo. Graph drawing will not work.

warnings.warn(msg, RuntimeWarning)

/usr/local/Cellar/graph-tool/2.27_6/lib/python3.7/site-packages/graph_tool/all.py:40: RuntimeWarning: Error importing draw module, proceeding nevertheless: No module named ‘cairo’

warnings.warn(msg, RuntimeWarning)