https://github.com/igraph/igraph/issues/640. When trying to pip install python-igraph, version 0.7 yields the following error:
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/libxml2.a(entities.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/libxml2.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
The server is not mine, so I am not a sudoer or anything.The solution is mentioned in the github issue:
I modified the setup.py as follows:
I changed the line
variants = ["lib{0}.a", "{0}.a", "{0}.lib", "lib{0}.lib"]
to
variants = ["lib{0}.so", "{0}.so"]
I downloaded Python 2.7.9's source code and compiled it on a local directory. I then added it to my PATH so that my newly compiled version would be the one I use by default. I logged out, logged in, downloaded the python-igraph source code, and modified the variants in the setup.py and used Python to install igraph:python setup.py install
ImportError: libigraph.so.0: cannot open shared object file: No such file or directory
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/path/to/build/source/of/python-igraph-0.7/igraphcore/lib
and now igraph could be imported from my own Python installation.
I am writing this post because:
- I almost resorted to using the crappy C API of igraph; such desperation is surely worth of a post.
- The answer supplied by the igraph team here: http://lists.nongnu.org/archive/html/igraph-help/2014-09/msg00041.html
is misleading and did not help me, so I thought it'd be worth to upvote the GitHub issue answer by a link.
That's it.
No comments:
Post a Comment