我在我的 mac 中安装了 igraph for python 但我无法导入它。首先我安装了 C 核心库,然后我继续安装 python,方法是:
python setup.py build
python setup.py install
一切似乎都很好,但我无法从 python shell 导入 igraph。澄清一下,我不在 igraph 源代码的文件夹中。我得到了这个错误:
import igraph
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.3-fat/egg/igraph/__init__.py", line 30, in <module>
File "build/bdist.macosx-10.3-fat/egg/igraph/core.py", line 7, in <module>
File "build/bdist.macosx-10.3-fat/egg/igraph/core.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/*****/.python-eggs/python_igraph-0.5.4-py2.7-macosx-10.3-fat.egg-tmp/igraph/core.so, 2): Symbol not found: _igraph_vector_destroy
Referenced from: /Users/*****/.python-eggs/python_igraph-0.5.4-py2.7-macosx-10.3-fat.egg-tmp/igraph/core.so
Expected in: dynamic lookup
我用*替换了我的文件夹名称,所以不要考虑它。
我在 OS 10.6.7 上运行 python 2.7。所以没有可用的 igraph 预编译版本(仅限 2.5 和 2.6)。这个错误与我正在运行的 python 版本有什么关系吗?如果可能的话,我该如何解决这个问题?