33

I have changed my computer to a Linux Mint x64 OS and I have throubles with a python library, igraph library, when i try to execute and old program I made.

DeprecationWarning: To avoid name collision with the igraph project, this visualization library has been renamed to 'jgraph'. Please upgrade when convenient.

I can't find information about how to change my code for the new library. On a Win8 PC, via pip installation, it works perfectly but I can't make it working on my PC with Mint. The normal installation made with

sudo apt-get install python-igraph

install 0.6.5-1 library version. I've also tried installing it with pip but it gives me same error but installed version is igraph-0.1.11-py2.py3-none-any.whl

I'm using only Graph class

from igraph import Graph

What have I to do to change my code to make it working with the new library? Am I missing something?

edit: it's working on my laptop with Mint x86 OS, library version 0.6.5-1

BugliL
  • 492
  • 1
  • 6
  • 16

2 Answers2

87

I think you have installed the wrong igraph libray.

This igraph(0.1.11) is the one you installed, while this igraph(0.7.1) is the one you need (and the well-known iGraph).

  • Using pip (once you've installed it), Just do:

    sudo pip uninstall igraph

  • Then install the python-igraph-0.7.1 package, using either pip or apt-get as mentionned in comments below:

    sudo pip install python-igraph

Hope it works.

ylnor
  • 3,299
  • 1
  • 18
  • 35
  • it works if I donwload the source code from the website and I add the library _igraph.so installed with python-igraph package via apt-get to the same folder – BugliL Mar 25 '16 at 09:53
  • Great. So the problem seemed to be that you actually had the wrong library (the one provided by Patrick Fuller) wich is missleading since the needed one is usualy the one provided by Tamas Nepusz. I update my answer so you can mark it as correct. – ylnor Mar 29 '16 at 08:29
  • 2017 checking in. this doesnt seem to work in macOS Sierra. – swyx May 10 '17 at 14:39
  • DON'T `sudo` pip. If you've accidentally `sudo`'d in the past, it's safer to `pip install python-igraph --user` – spacetyper Mar 27 '18 at 18:49
  • First "pip install python-igraph" then "import igraph as ig" worked for me. Thanks. – Fatemeh Asgarinejad May 07 '21 at 20:27
8
sudo -H pip uninstall igraph

then:

sudo pip install python-igraph

worked for me.

Hadley King
  • 89
  • 1
  • 4