Permanently adding to DYLD_LIBRARY_PATH on MAC causes X11 errors

前端 未结 1 400
野性不改
野性不改 2021-01-14 19:22

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

相关标签:
1条回答
  • 2021-01-14 19:53

    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 RPATHs 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.

    0 讨论(0)
提交回复
热议问题