Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 我能';在mac 10.6上导入igraph_Macos_Import_Python 2.7_Igraph - Fatal编程技术网

Macos 我能';在mac 10.6上导入igraph

Macos 我能';在mac 10.6上导入igraph,macos,import,python-2.7,igraph,Macos,Import,Python 2.7,Igraph,我在mac中安装了python的igraph,但无法导入它。首先我安装了C核心库,然后我继续安装python,方法是: python setup.py build python setup.py install 一切似乎都很好,但我无法从python shell导入igraph。我只是想澄清一下,我不在igraph源代码的文件夹中。我得到了这个错误: import igraph Traceback (most recent call last): File "<stdin>",

我在mac中安装了python的igraph,但无法导入它。首先我安装了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
导入igraph
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“build/bdist.macosx-10.3-fat/egg/igraph/_init__.py”,第30行,in
文件“build/bdist.macosx-10.3-fat/egg/igraph/core.py”,第7行,in
文件“build/bdist.macosx-10.3-fat/egg/igraph/core.py”,第6行,在引导程序中__
导入错误:dlopen(/Users/*****/.python-eggs/python_-igraph-0.5.4-py2.7-macosx-10.3-fat.egg-tmp/igraph/core.so,2):未找到符号:_-igraph_-vector_
引用自:/Users/******/.python-eggs/python_-igraph-0.5.4-py2.7-macosx-10.3-fat.egg-tmp/igraph/core.so
应为:动态查找
< >我把文件夹的名称替换为<强> *>强>,所以不要考虑它。

我正在OS10.6.7上运行python 2.7。因此没有可用的igraph预编译版本(仅2.5和2.6)。这个错误与我正在运行的python版本有关吗?
如果可能的话,我该如何解决这个问题呢?

我认为问题在于igraph安装在
/usr/local/lib/libigraph.dylib
中,但是当Python尝试加载igraph模块的C内核时,链接器找不到它,因为
/usr/local/lib
不在Mac OS X中的默认库路径上(至少我这样认为)

首先,请检查
libigraph.dylib
是否真的在
/usr/local/lib
中-它应该在那里。之后,请尝试以下操作:

DYLD_LIBRARY_PATH=/usr/local/lib python -m igraph.test.__init__

这应该指示链接器在
/usr/local/lib
以及默认位置中查找,然后在整个igraph测试套件中运行Python。

我认为问题在于igraph安装在
/usr/local/lib/libigraph.dylib
中,但是当Python试图加载igraph模块的C内核时,链接器找不到它,因为在MacOSX中,
/usr/local/lib
不在默认库路径上(至少我认为是这样)

首先,请检查
libigraph.dylib
是否真的在
/usr/local/lib
中-它应该在那里。之后,请尝试以下操作:

DYLD_LIBRARY_PATH=/usr/local/lib python -m igraph.test.__init__

这应该指示链接器在
/usr/local/lib
以及默认位置中查找,然后在整个igraph测试套件中运行Python。

您在哪里安装了igraph的C内核?它是否位于链接器可以找到它的某个标准位置?您的机器上是否有其他安装的core library(旧版本)可能会混淆链接器?实际上,我以前没有安装core library。我认为C核心安装在标准位置,因为我没有指定任何位置。我刚刚做了:
/configure
然后
make
然后
make install
()。我应该把它安装在哪里?如果要更改安装位置,如何设置C core的安装路径,以及如何删除安装在错误目录中的路径?(对不起,我是mac的初学者)通常的
/configure&&make&&make install
舞蹈应该在
/usr/local/lib/libigraph.dylib中安装igraph,这应该没问题。您确定下载和编译的igraph core的版本号与Python接口的版本号匹配吗?我已经下载并安装了sourceforge上可用的最新版本,即0.5.4。我的Python接口的版本号是2.7。你在哪里安装了igraph的C内核?它是否位于链接器可以找到它的某个标准位置?您的机器上是否有其他安装的core library(旧版本)可能会混淆链接器?实际上,我以前没有安装core library。我认为C核心安装在标准位置,因为我没有指定任何位置。我刚刚做了:
/configure
然后
make
然后
make install
()。我应该把它安装在哪里?如果要更改安装位置,如何设置C core的安装路径,以及如何删除安装在错误目录中的路径?(对不起,我是mac的初学者)通常的
/configure&&make&&make install
舞蹈应该在
/usr/local/lib/libigraph.dylib中安装igraph,这应该没问题。您确定下载和编译的igraph core的版本号与Python接口的版本号匹配吗?我已经下载并安装了sourceforge上可用的最新版本,即0.5.4。我的Python接口的版本号是2.7.0。如果要保留这些更改,请在主目录中编辑
.profile
文件,如下所示:
export DYLD\u LIBRARY\u PATH=/usr/local/lib
。太好了。如果要保留这些更改,请在主目录中编辑
.profile
文件,如下所示:
export DYLD\u LIBRARY\u PATH=/usr/local/lib