0
votes

I would like to use certain features of the Python library Igraph in Julia-lang. I am aware that there exists a Julia package Graphs but I specifically need Igraph. I have previously used python libraries with PyCall, but this time when I do.

using PyCall
@pyimport igraph

But I get error:

@pyimport not defined

My current Julia version is: 0.4.0-dev+147

Thanks in advance

1
You're trying to load a Python module in Julia? I'm pretty sure you can't do that. - Alex A.
I have used numpy in Julia with using PyCall, and then @pyimport numpy as np ... so I thought it could work... - RM-
The error you posted here says that @pyimport is not defined but you've used it successfully before? That's weird. Perhaps PyCall didn't load correctly...? - Alex A.
I used it a couple of months ago and worked... now it does not. - RM-
If it worked a couple of months ago and it no longer does, it probably has something to do with the fact that you're using the dev version of Julia. Does it work if you try it with the most recent stable release? (0.3.7, I think) - Alex A.

1 Answers

2
votes

From the main page of the igraph website:

igraph can be programmed in R, Python, and C/C++.

So right now there's no official native Julia package for igraph. In general, Julia can't read a package native to another language, so you'll either have to write your own interface for it or find a comparable existing Julia package.

You can browse available Julia packages on http://pkg.julialang.org.


Since you edited your question to be specific to PyCall, I'll address that as well.

Note that you're using a development version of Julia. Try using the latest stable release (0.3.7, I believe) and running your code using PyCall again.