Python下使用IGraph初探

1、环境的配置

下载下面的包并安装

按照下面的步骤安装 (feel free not to if you know what you’re doing):

  • Double-click on, run python-2.6.2.msi and agree to all defaults. This will install the Python interpreter in C:\Python26\.
  • Double-click on, run wxPython2.8-win32-unicode-2.8.10.1-py26.exe and agree to all defaults. This will install the wxPython package to C:\Python26\Lib\site-packages\wx-2.8-msw-unicode\
  • Double-click on, run wxPython2.8-win32-docs-demos-2.8.10.1.exe and agree to all defaults. This will install the docs and demos for wxPython to C:\Program Files\wxPython2.8 Docs and Demos\
  • Double-click on, run pycairo-1.8.4.win32-py2.6.exe and agree to all defaults. This will install the pyCairo Python wrapper package for Cairo to C:\Python26\Lib\site-packages\cairo\
  • Open cairo_1.8.6-1_win32.zip and extract only bin\libcairo-2.dll to C:\Python26\Lib\site-packages\cairo\libcairo-2.dll (note that the folder in the above path is “Lib”, not “libs”)
  • Open zlib123-dll.zip and extract only zlib1.dll to C:\Python26\Lib\site-packages\cairo\zlib1.dll
  • Open libpng_1.2.34-1_win32.zip and extract only bin\libpng12-0.dll to C:\Python26\Lib\site-packages\cairo\libpng12-0.dll

最后你的Lib\site-packages\cairo文件夹下应该是这样的:

  • __init__.py
  • __init__.pyc
  • __init__.pyo
  • _cairo.pyd
  • libcairo-2.dll
  • libpng12-0.dll
  • zlib1.dll

2、测试是否成功

>>> from igraph import *
>>> g = Graph.Famous("petersen")
>>> plot(g)

 

 

posted @ 2013-01-19 19:36  rovoqo  阅读(2137)  评论(0编辑  收藏  举报