Compiling the python-igraph with Python 2.7 on CentOS 5


Step 1: Install Python 2.7

python-igraph requires Python 2.5 and above. Do look at Installing and Compiling Python 2.7.8 on CentOS 5

Step 2: Download and unpack python-igraph from python-igraph.

The current version is python-igraph 0.7

Step 3: Unpack and compile

# tar -zxvf python-igraph-0.7.0
# cd  python-igraph-0.7.0
# python setup.py install

If you encounter errors similar to /usr/lib64/libxml2.a: could not read symbols: Bad value

Step 4: Copy and update to /usr/local/

If you want to put all the packages in an easier to find directory. Copy

# mkdir -p /usr/local/python-igraph-0.7.0/bin
# mkdir -p /usr/local/python-igraph-0.7.0/lib
# cp $PYTHON-IGRAPH-HOME/build/scripts-2.7/igraph /usr/local/python-igraph-0.7.0/bin
# cp -rv $PYTHON-IGRAPH-HOME/build/scripts-2.7/lib.linux-x86_64-2.7/igraph /usr/local/python-igraph-0.7.0/lib
# cp -rv $PYTHON-IGRAPH-HOME/igraphcore/lib/libigraph.so* /usr/local/python-igraph-0.7.0/lib

Step 5: Test the python-igraph libraries.
Update .bashrc

export PATH=$PATH:/usr/local/python-igraph-0.7.0/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/python-igraph-0.7.0/lib

Test with python on the command line

$ python2.7
Python 2.7.8 (default, Jul 17 2014, 14:44:57)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import igraph
>>>

 


*Easier Method*

You can use pip to install. For more information on how to install and use pip, see Installing and Compiling Python 2.7.8 on CentOS 5

 

References:

  1. Python, igraph in CentOS
  2. Installing python-igraph on linux

 

Advertisements

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