[vtkusers] Problem with building VTK 5.0.3 with Python/Tk on Mac OSX 10.4.1

Thomas, JMH (Jens) j.m.h.thomas at dl.ac.uk
Mon Dec 10 07:49:20 EST 2007

Hi Sean,

Thanks for getting back to me.

>Also, do you really mean 10.4.1?  Or do you mean 10.4.11 or 10.5.1?  In
>any case, which version of Xcode do you have?

Sorry - that was a typo, it's OSX 10.4.11 with Xcode 2.5

>>I've attached my CmakeCache.txt and have included some additional
>>information below in case it is of any use.

>1200 lines of text is a lot... :)  What settings did you change from
>their default?



>If you are on 10.5, I suggest CVS CMake also.

I've redone the build with CVS versions of both VTK and CMake. The build fails twice as -ltcl is missing from the link stage for libvtkCommonTCL.5.1.0.dylib and the file vtk right at the end of the build.

I was able to fix the former by editing the file Common/CMakeFiles/vtkCommonTCL.dir/link.txt to add -ltcl and the latter by manually executing the link for vtk and appending -ltcl.

This allows the build to run to completion.

However, if I install the python files (using setup.py) and then try and run the file:


It fails with the error:

  File "./vtkTkRenderWidget.py", line 466, in <module>
  File "./vtkTkRenderWidget.py", line 443, in vtkRenderWidgetConeExample
    pane = vtkTkRenderWidget(root,width=300,height=300)
  File "./vtkTkRenderWidget.py", line 81, in __init__
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/vtk/tk/vtkLoadPythonTkWidgets.py", line 67, in vtkLoadPythonTkWidgets
    interp.call('load', filename)
_tkinter.TclError: image not found
NSCreateObjectFileImageFromFile() error: not a Mach-O MH_BUNDLE file

It appears it's trying to load the file libvtkRenderingPythonTkWidgets.dylib, but this file hasn't been built (which I think is because the Cmake variable VTK_USE_TK hasn't been set, even though the Tcl and Tk libraries were found during the configure).

Is there an easy way to fix this?

>Lastly, there are some Mac dashboards that enable TCL, you may want to
>look at their settings.

I'm not very familiar with dashboard, so it's quite possible I missed something, but've looked at


and couldn't find any that had the python and tcl wrapping turned on.

Best wishes,


Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada

More information about the vtkusers mailing list