问题
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