I am using Python 2.7 and am trying to import graph_tool, and it seems that my libboost_thread-mt.dylib is located in /opt/local/lib rather than /usr/local/lib.
If
Trying to permanently set DYLD_LIBRARY_PATH
is almost always an indication that you are doing something wrong. On OS X, well-designed components embed absolute paths or RPATH
s to shared libraries so that setting environment variables to override library search paths should seldom be needed.
Since you show path /opt/local/lib
, I assume you are using MacPorts since this is its default installation path. If you are not able to import a MacPorts-installed Python package, chances are you are using the wrong Python instance. MacPorts installs all Python packages to its own Python interpreter. So, if you installed the Python 2.7 version with:
sudo port install py27-graph-tool
MacPorts would also have installed, if not installed already, its own python2.7
in /opt/local/bin
. Try running that instead and doing the import there.
/opt/local/bin/python2.7
If you haven't already, you should add /opt/local/bin
to your shell PATH in a shell startup file, like ~/.profile
, so you don't need to always type /opt/local/bin
.