[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Help with python-igraph on CentOS 6.5
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] Help with python-igraph on CentOS 6.5 |
Date: |
Fri, 17 Oct 2014 22:15:55 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
> Apparently, I needed to also install libxml2-devel.
True - you need this package to *compile* applications that use libxml2;
libxml2 alone is enough only to *run* applications that use libxml2.
> Python wont read graphml files, but because I am calling Python
> from R in a system call, system('python myscript.py'), and while R can
> write a graphml file, the python called from R can seem to read it.
Are you sure that you are invoking the same Python installation on your system
from R as the one you invoke from the command line? One possibility to check it
is as follows::
>>> import sys
>>> sys.executable
This should print the same path no matter whether you run Python from R or from
the shell.
Also, it could be the case that the R process is running Python under
a different user so the Python path (the set of locations where Python looks
for its modules) is different. Try this one as well and compare the output:
>>> import sys
>>> sys.path
For me it seems like you have two different copies of igraph's Python interface
on your machine (probably from your earlier experimentations), and one of them
has GraphML supoprt while the other hasn't.
> call python from the command line, the file is read and then the python
> script writes a new graphml file, which unfortunately R can't read.
What does it mean that R cannot read it? What is the error message? Try giving
read permissions for everyone on that file from the command line (not from
Python):
$ chmod a+r your_file.graphml
> I know when I run python from the command line it has root permissions
That seems to be pretty insecure if this is the case, but let's assume that it
is indeed this way. If you have a root shell, you can also adjust the ownership
of the GraphML file to transfer it to the 'shiny' user. (Note that you will
still be able to do anything with it since you have a root shell).
$ chown shiny your_file.graphml
All the best,
--
T.