Reputation: 37
I want to use the python wrapper from igraph. Compiling igraph and installing python-igraph works fine, but when I try to import igraph I get the following error (see image link below):
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.4/dist-packages/igraph/__init__.py", line 34, in <module>
from igraph._igraph import *
ImportError: /usr/local/lib/python3.4/dist-packages/igraph/_igraph.cpython-34m.so: undefined symbol: igraph_gomory_hu_tree
Upvotes: 2
Views: 3767
Reputation: 1
FYI: Tried for more than a day with all kinds of resources online for installing python-igraph
on mac. And I also wasn't able to import graph
in .py file or .ipynb. Though it did allow me to import igraph
in terminal when launching python. My solution is to make a virtual environment, conda install -c conda-forge python-igraph
, then switch python from version 3.8 (which never passes the igraph.test.run_tests
, Failed = 2) to 3.5 (passed the test). Hope it helps.
Upvotes: 0
Reputation: 43
It's because python doesn't find the igraph library. You can simply export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
(or wherever the file libigraph.so is located on your system).
Upvotes: 0
Reputation: 501
I also had some trouble with igraph and python, my solution:
pyvenv-3.4 yourVenv
. yourVenv/bin/activate
pip install python-igraph
That one works for me.
Upvotes: 3
Reputation: 153
Try using the 'wraptext' import that comes with python. Then use .fill() to wrap the text over the next line. That might work.
Upvotes: 0