[vtkusers] Missing libvtkRenderingPythonTkWidgets on OSX

Jens linucks42 at gmail.com
Sun Sep 14 07:29:59 EDT 2014


Hi,

I downloaded the latest vtkpython bundle for OSX:

http://www.vtk.org/files/release/6.1/vtkpython-6.1.0-Darwin-64bit.tar.gz

and am trying to use it with Tk.

I've tried to create the simplest script I can to illustrate the problem,
which I've pasted in below.

I run the script using the vtkpython binary.

I firstly have to add the path to the vtk .so files to the python system
path or the script fails with:

    import vtk.tk.vtkTkRenderWidget

  File
"/opt/VTK-6.1.0-Darwin-64bit/vtkpython/bin/vtk/tk/vtkTkRenderWidget.py",
line 51, in <module>

    from vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets

  File
"/opt/VTK-6.1.0-Darwin-64bit/vtkpython/bin/vtk/tk/vtkLoadPythonTkWidgets.py",
line 2, in <module>

    import vtkCommonCorePython

ImportError: No module named vtkCommonCorePython


Firstly, shouldn't vtkpython already do this, or am I using it incorrectly?


If I add the path with the sys.insert... line, the script then fails with:


    pane =
vtk.tk.vtkTkRenderWidget.vtkTkRenderWidget(root,width=300,height=300)

  File
"/opt/VTK-6.1.0-Darwin-64bit/vtkpython/bin/vtk/tk/vtkTkRenderWidget.py",
line 81, in __init__

    vtkLoadPythonTkWidgets(master.tk)

  File
"/opt/VTK-6.1.0-Darwin-64bit/vtkpython/bin/vtk/tk/vtkLoadPythonTkWidgets.py",
line 73, in vtkLoadPythonTkWidgets

    interp.call('load', filename, pkgname)

_tkinter.TclError: dlopen(libvtkRenderingPythonTkWidgets-6.1.dylib, 10):
image not found


I've looked and the libvtkRenderingPythonTkWidgets-6.1.dylib library is
nowhere to be found.


Is it missing from the package, or is something else going on?


Best wishes,


Jens



import sys


# Need to add this manually

sys.path.insert(0,"/opt/VTK-6.1.0-Darwin-64bit/vtkpython/bin/vtk")


import vtk

import Tkinter

import vtk.tk.vtkTkRenderWidget


# create root window

root = Tkinter.Tk()


# create vtkTkRenderWidget

pane =
vtk.tk.vtkTkRenderWidget.vtkTkRenderWidget(root,width=300,height=300)


ren = vtk.vtkRenderer()

renWin = pane.GetRenderWindow()

renWin.AddRenderer(ren)


# pack the pane into the tk root

pane.pack()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140914/15dddaba/attachment.html>


More information about the vtkusers mailing list