graph-tool crahes on import

女生的网名这么多〃 提交于 2019-12-25 16:24:18

问题


Using Python 2.7 I try to import graph-tool:

from graph_tool.all import *

Each time I execute the above command the following error is returned and Python crashes.

dyld: lazy symbol binding failed: Symbol not found: __ZN5boost6python6detail11init_moduleEPKcPFvvE Referenced from: /usr/local/lib/python2.7/site-packages/graph_tool/libgraph_tool_core.so Expected in: flat namespace

dyld: Symbol not found: __ZN5boost6python6detail11init_moduleEPKcPFvvE Referenced from: /usr/local/lib/python2.7/site-packages/graph_tool/libgraph_tool_core.so Expected in: flat namespace

Trace/BPT trap: 5

I installed graph-tool with homebrew on Mac OSX 10.10. Does anybody know how to fix this issue?


回答1:


There is probably a mismatch between the python version you are using, and the one used to compile boost::python and graph-tool.

For example, you might be using the system's python, whereas graph-tool/python were compiled with a version installed via homebrew.




回答2:


Python modules have been installed but the site-packages may not be in your Python sys.path, so you will not be able to import the modules this formula installed. If you plan to develop with these modules, please run like this:

mkdir -p /Users/myname/Library/Python/2.7/lib/python/site-packages

echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/myname/Library/Python/2.7/lib/python/site-packages/homebrew.pth

In my case it's the homebrew site-packages, but may not yours



来源:https://stackoverflow.com/questions/31411447/graph-tool-crahes-on-import

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!