# Error importing vtkTkRenderWindowInteractor in vtk 8.2.0

**URL:** <https://discourse.vtk.org/t/error-importing-vtktkrenderwindowinteractor-in-vtk-8-2-0/856>\
**Category:** Support\
**Created:** [April 27, 2019, 1:12pm UTC](https://discourse.vtk.org/t/error-importing-vtktkrenderwindowinteractor-in-vtk-8-2-0/856 "2019-04-27T13:12:23Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![Julie](https://discourse.vtk.org/user_avatar/discourse.vtk.org/julie/32/351_2.png) [@Julie](https://discourse.vtk.org/u/Julie)\
**Post date:** [May 7, 2019, 3:37pm UTC](https://discourse.vtk.org/t/error-importing-vtktkrenderwindowinteractor-in-vtk-8-2-0/856/21 "2019-05-07T15:37:06Z")

</div>

Hi, David

The result of “otool -l” is as below.

 ![39%20PM](https://discourse.vtk.org/uploads/default/original/1X/3d6e24f4bb6037123ac88ce6c880dda5767fe9ff.jpeg)

And the related cmake config is as below:

 ![09%20PM](https://discourse.vtk.org/uploads/default/original/1X/5e6e6797f485bb1ac9c86dc43d637e47ca15f74a.png)

Since I want to use the virtual environment(…/anaconda2/envs/vtk-8.2.1) in anaconda, how should I set these parameters?

Thank you sooooooo much.

Best,

Julie

---

<div class="post-metadata">

**Author:** ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)\
**Post date:** [May 7, 2019, 3:44pm UTC](https://discourse.vtk.org/t/error-importing-vtktkrenderwindowinteractor-in-vtk-8-2-0/856/22 "2019-05-07T15:44:05Z")

</div>

You have to give “otool -l” the path to a library or executable:

```
otool -l <object file>

```

See “man otool” for more information.

---

<div class="post-metadata">

**Author:** ![Julie](https://discourse.vtk.org/user_avatar/discourse.vtk.org/julie/32/351_2.png) [@Julie](https://discourse.vtk.org/u/Julie)\
**Post date:** [May 7, 2019, 4:24pm UTC](https://discourse.vtk.org/t/error-importing-vtktkrenderwindowinteractor-in-vtk-8-2-0/856/23 "2019-05-07T16:24:17Z")

</div>

Hi, David

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` ” .

Thanks.

---

<div class="post-metadata">

**Author:** ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)\
**Post date:** [May 7, 2019, 4:26pm UTC](https://discourse.vtk.org/t/error-importing-vtktkrenderwindowinteractor-in-vtk-8-2-0/856/24 "2019-05-07T16:26:32Z")

</div>

Check `_tkinter.cpython-36m-darwin.so` and `libvtkRenderingPythonTkWidgets-8.2.dylib` to see what tcl and tk libraries they link to at runtime.

---

<div class="post-metadata">

**Author:** ![Julie](https://discourse.vtk.org/user_avatar/discourse.vtk.org/julie/32/351_2.png) [@Julie](https://discourse.vtk.org/u/Julie)\
**Post date:** [May 7, 2019, 7:15pm UTC](https://discourse.vtk.org/t/error-importing-vtktkrenderwindowinteractor-in-vtk-8-2-0/856/26 "2019-05-07T19:15:40Z")

</div>

Hi, David,

They do link to different Tcl and Tk. Then how should I configure cmake?

The result is as below:

1. `libvtkRenderingPythonTkWidgets-8.2.dylib` :

 ![13%20PM](https://discourse.vtk.org/uploads/default/original/1X/40913d0a6178615022bce83b0bdb66a531d62c05.png)

 ![Screen Shot 2019-05-07 at 9.06.25 PM.jpg](https://discourse.vtk.org/uploads/default/original/1X/7d1c2d8e8c12076eaeafbd334e8f89df7c4511ac.jpeg)

1. `_tkinter.cpython-36m-darwin.so` :

 ![24%20PM](https://discourse.vtk.org/uploads/default/original/1X/c3fdf20c65870717e5c0d5ea2d79e7d74df86813.png)

 ![Screen Shot 2019-05-07 at 9.09.16 PM.png](https://discourse.vtk.org/uploads/default/original/1X/2855303d93385ee86ef184588af23975281ca16b.png)

Thanks

---

<div class="post-metadata">

**Author:** ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)\
**Post date:** [May 7, 2019, 8:02pm UTC](https://discourse.vtk.org/t/error-importing-vtktkrenderwindowinteractor-in-vtk-8-2-0/856/27 "2019-05-07T20:02:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Julie](https://discourse.vtk.org/user_avatar/discourse.vtk.org/julie/32/351_2.png) [@Julie](https://discourse.vtk.org/u/Julie)\
**Post date:** [May 7, 2019, 10:14pm UTC](https://discourse.vtk.org/t/error-importing-vtktkrenderwindowinteractor-in-vtk-8-2-0/856/28 "2019-05-07T22:14:59Z")

</div>

Hi David,

The problem is solved, like magic!  
I don’t know how to express my gratitude! Thank you soooooooooo much.  
😘😘😘😘😘😘🥳🥳🥳🥳  
Best regards,  
Julie

---

<div class="post-metadata">

**Author:** ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)\
**Post date:** [May 7, 2019, 10:54pm UTC](https://discourse.vtk.org/t/error-importing-vtktkrenderwindowinteractor-in-vtk-8-2-0/856/29 "2019-05-07T22:54:35Z")

</div>

Nice! Let me breathe a little sigh of relief…

[Previous page](https://discourse.vtk.org/t/error-importing-vtktkrenderwindowinteractor-in-vtk-8-2-0/856.md?page=1)
