Home > life is fun > python-igraph installed on Anaconda + Mac OSX 10.8, successfully!

python-igraph installed on Anaconda + Mac OSX 10.8, successfully!


I have to say, python on Mac, is a nightmare, when dealing with non-mainstream pkgs, like igraph.
I struggled for 2 days, and finally, python-igraph installed on Anaconda + Mac OSX 10.8, successfully!

The steps:

  • brew install homebrew/science/python-igraph  , to download and install the executables into /usr/local/Cellar/python-igraph/ 
  • brew link homebrew/science/python-igraph , turns out to be the key step that most websites missed!! somehow, on my mac, after my brew install, the brew link was skipped. this caused all sort of weird complications!
  • pip install python-igraph , if you have skipped the brew link, I’m sure you would struggle for a while with such errors below ! Now Victor to the rescue! 🙂

Mission accomplished! Time to play some more Data Science work! 🙂

 

Error message if brew install messed up:

 

sudo pip install python-igraph
Downloading/unpacking python-igraph
  Downloading python-igraph-0.7.tar.gz (371kB): 371kB downloaded
  Running setup.py egg_info for package python-igraph
    
Installing collected packages: python-igraph
  Running setup.py install for python-igraph
    Cannot find the C core of igraph on this system using pkg-config.
    We will now try to download and compile the C core from scratch.
 
 
 
grep: /usr/lib/libiconv.la: No such file or directory
 
sed: /usr/lib/libiconv.la: No such file or directory
 
libtool: link: `/usr/lib/libiconv.la‘ is not a valid libtool archive
 
make[3]: *** [libigraph.la] Error 1
 
make[2]: *** [all] Error 2
 
make[1]: *** [all-recursive] Error 1
 
make: *** [all] Error 2
 
 
 
Extracting igraph-0.7.0.tar.gz…
 
Configuring igraph…
 
Could not download and compile the C core of igraph.
 
 
 
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
 
 
 
Build type: dynamic extension                                    
 
Include path: /usr/include/igraph /usr/local/include/igraph
 
Library path:
 
Linked dynamic libraries: igraph
 
Linked static libraries:
 
Extra compiler options:
 
Extra linker options:
 
building ‘igraph._igraph’ extension
 
creating build/temp.macosx-10.5-x86_64-2.7
 
creating build/temp.macosx-10.5-x86_64-2.7/src
 
gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -arch i386 -arch x86_64 -I/usr/include/igraph -I/usr/local/include/igraph -I../../build/include -I../../include -I/usr/local/include/igraph -I/usr/include/igraph -I/Users/fangc2/anaconda/include/python2.7 -c src/arpackobject.c -o build/temp.macosx-10.5-x86_64-2.7/src/arpackobject.o
 
In file included from src/arpackobject.c:23:
 
src/arpackobject.h:27:10: fatal error: ‘igraph_arpack.h’ file not found
 
#include <igraph_arpack.h>
 
         ^
 
1 error generated.
 
error: command ‘gcc’ failed with exit status 1
Advertisements
Categories: life is fun
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: