I just read the description of otool command. But I am really newbie on this kind of thing. I am still feel lost. Could you give me some hints of which library (or executable) should I check? “ libvtkRenderingPythonTkWidgets-8.2.dylib ”? And what information should I find in the result?
By the way, “ _tkinter.cpython-36m-darwin.so ” is under “ ../anaconda2/envs/vtk-8.2.1/lib/python3.6/lib-dyload ” .
Change the cmake settings so that VTK uses the same libtcl and libtk that _tkinter links to (of course, make sure that VTK uses the tcl/tk include directories that match those same libraries!)
The output from otool shows that _tkinter links to @rpath/libtk8.6.dylib, and it will also show what LC_RPATH is set to, so that will give you the full path to libtk8.6.dylib and libtcl8.6.dylib.
After rebuilding, you might also have to set the LC_RPATH in libvtkRenderingPythonTkWidgets-8.2.dylib so that it matches the LC_RPATH used by the anaconda _tkinter. On OS X, the program install_name_tool can be used to manipulate paths that are embedded within libraries and executables.
Do a google of “dylib rpath” for an introduction to the wonderful world of rpaths and how they can be used.