Permanently adding to DYLD_LIBRARY_PATH on MAC causes X11 errors

拥有回忆 提交于 2019-12-01 11:23:30

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.

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