6

Windows 7 64-bit

Python 2.7.7 64-bit Anaconda

Trying to install python-igraph python-igraph-0.7.1-4.tar.gz from https://pypi.python.org/pypi/python-igraph.

I have gone through Install python-igraph with the anaconda distribution (windows), Can I install Python windows packages into virtualenvs? and related links to debug the problem.

I understand the problem arises because there is no C-core. Error message also contains this message when i try installing through easy_install -

Cannot find the C core of igraph on this system using pkg-config.

WARNING: we were not able to detect where igraph is installed on
your machine (if it is installed at all). We will use the fallback
library and include pathss hardcoded in setup.py and hope that the
C core of igraph is installed there.
If the compilation fails and you are sure that igraph is installed
on your machine, adjust the following two variables in setup.py
accordingly and try again:
- LIBIGRAPH_FALLBACK_INCLUDE_DIRS
- LIBIGRAPH_FALLBACK_LIBRARY_DIRS 

Could you provide any pointers towards a solution. Thanks.

Community
  • 1
  • 1
viva
  • 103
  • 2
  • 12
  • Have you tried one of the Windows installers of `python-igraph` from Christoph Gohlke's page (http://www.lfd.uci.edu/~gohlke/pythonlibs/)? – Tamás Mar 23 '15 at 14:26
  • Thanks for the reply. I have tried the .whl install and the message i get is - python_igraph-0.7.1.post4-cp34-none-win_amd64.whl is not a supported wheel on this platform. – viva Mar 24 '15 at 23:43
  • @Tamás, I tried to follow to install the .whl file, but get a message as - D:\FileNamegoeshere>wheel install python_igraph-0.7.1.post4-cp3 4-none-win_amd64.whl python_igraph-0.7.1.post4-cp34-none-win_amd64.whl is not compatible with this Python. --force to install anyway. – viva Mar 25 '15 at 00:57
  • You downloaded a wheel for Python 3.4 (that's what `cp34` means in the filename) while you have Python 2.7. Download the wheel for Python 2.7 instead. – Tamás Mar 25 '15 at 08:29
  • @Tamás, Thanks. Installs as expected. Can you please add the comment as an answer so i can accept it. Thanks. – viva Mar 26 '15 at 12:07

3 Answers3

8

Christoph Gohlke's page hosts several pre-compiled packages for Python on Windows, including igraph's Python interface. Download the Python wheel corresponding to your Python version from that page and install it using the pip command. Since you are using Python 2.7, you will need the one that has cp27 in its filename.

Tamás
  • 47,239
  • 12
  • 105
  • 124
5

I just had the same problem, neither via the pycharm installer nor the pip install I was able to install python-igraph.

The solution given by Tamás has worked for me. Download the the file you need from Christoph Gohles page.

Open the terminal

> cd ./ContainingFolder
> pip install python_igraph-0.7.1.post4-cp34-none-win_amd64.whl
Processing c:\users\username\ContainingFolder\python_igraph-0.7.1.post4-cp34-none-win_amd64.whl
Installing collected packages: python-igraph

Successfully installed python-igraph-0.7.1.post4
  • Thanks. I get message as - "python_igraph-0.7.1.post4-cp34-none-win_amd64.whl is not a supported wheel on this platform." Is there any pre-requisite before i install python-igraph that you are aware of? – viva Mar 24 '15 at 23:45
  • 1
    You downloaded a wheel for Python 3.4 (that's what `cp34` means in the filename) while you have Python 2.7. Download the wheel for Python 2.7 instead. – Tamás Mar 25 '15 at 08:30
  • Hi, I have downloaded both python_igraph-0.7.1.post6-cp34-none-win_amd64.whl python_igraph-0.7.1.post6-cp35-none-win_amd64.whl and tried to install them with pip install on a Windows 10 virtual box that is running Python 3.6.2 (pycairo is installed). I got this error message back python_igraph-0.7.1.post6-cp35-none-win_amd64.whl is not a supported wheel on this platform. Does this mean that Python 3.6 is not supported ? – Athanassios Jul 24 '17 at 14:40
  • basically there is an new package for the latest version of python 3.7.1. the name of the file is `python_igraph-0.7.1.post6-cp37-cp37m-win_amd64.whl`. Worked for me. – Michele La Ferla May 23 '19 at 08:59
0

I know this comes very late as an answer however Christoph Gohlke's page still contains updated libraries in whl format for many packages, even for igraph. Took me quite some time to get around this but I finally managed.

These are the steps I took:

First thing to do is install the latest version of numpy+mkl from here. Check that the version you download is relevant to your Python version. After downloading it, you need to install it using the following command in Terminal: pip install numpy‑1.16.3+mkl‑cp37‑cp37m‑win32.whl (check the filename for the file you downloaded and replace it in the command).

Secondly, you need to install the latest version of wheel to read from whl files which you will download in the next stages. This is not necessary but in my case, for some reason pip did not read the whl files without it. You can install it by using this command in Terminal: pip install wheel.

Thirdly you need to download and install the Python version of Cairo. This is a library which allows for the visualisation of many igraph graphs. Without it the igraph library will not work well. This library is provided by Christoph Gohlke in this link. Check that the version you download is relevant to your Python version. After downloading it, you need to install it using the following command in Terminal: pip install pycairo‑1.18.0‑cp37‑cp37m‑win32.whl (check the filename for the file you downloaded and replace it in the command).

Finally you can install igraph. Here again you need to download it from Christoph Gohlke's site and install it. Again check the package which matches your Python version when downloading it and again install it using the command in Terminal: pip install python_igraph-0.7.1.post6-cp37-cp37m-win32.whl (check the filename for the file you downloaded and replace it in the command).

After installing the packages, you can start working using something similar to the following:

from graphframes import *
from igraph import *

gf = GraphFrame(vertex, edge)
ig = Graph.TupleList(gf.edges.collect(), directed=True)
plot(ig)

Hope this helps break the myth :)

Michele La Ferla
  • 6,775
  • 11
  • 53
  • 79