Vtk works fine, but not with Python ... ???

Lloyd Zusman ljz at asfast.com
Fri Apr 30 22:44:26 EDT 1999


I'm using Python 1.5.2 under RedHat Linux 5.0.  I have recently
downloaded and built vtk, including the Python wrappers.  I have
followed the instructions given on the vtk web site (summarized
below), and the result is a version of vtk which works fine under tcl
and as a stand-alone.  All example scripts I try to run via vtk work
perfectly.

However, when I try to run any vtk Python examples, I get the
following error no matter what script I try to run:

  % python earth.py
  Traceback (innermost last):
    File "earth.py", line 4, in ?
      from libVTKGraphicsPython import *
  ImportError: /usr/local/lib/python1.5/lib-dynload/libVTKGraphicsPython.so:
      undefined symbol: XtStrings

I'm wondering if anyone has seen this problem, or could suggest a way
to fix it.

Before you tell me that my LD_LIBRARY_PATH is set wrong, or that I
didn't run ldconfig, I want to point out that /usr/X11R6/lib is in my
LD_LIBRARY_PATH, and this directory contains the libXt.so, libXt.so.6
and libXt.so.6.0 libraries (two are symbolic links pointing to the
third one).  Furthermore, my /etc/ld.so.conf file does contain
/usr/X11R6/lib, and running `ldconfig -v' indeed shows this library.

Also, the following vtk libraries have been successfully built and
installed in /usr/local/lib.  And /usr/local/lib also appears in
LD_LIBRARY_PATH and /etc/ld.so.conf, and running `ldconfig -v' shows
these libraries:

  libVTKCommon.so
  libVTKCommonTcl.so
  libVTKContrib.so
  libVTKContribTcl.so
  libVTKGraphics.so
  libbVTKGraphicsTcl.so
  libVTKImaging.so
  libVTKImagingTcl.so
  libVTKImagingPython.so
  libVTKPatented.so
  libVTKPatentedTcl.so

In addition, these libraries have been successfully built and put into
this Python subdirectory:  /usr/local/lib/python1.5/lib-dynload  ...

  libVTKCommonPython.so
  libVTKContribPython.so
  libVTKGraphicsPython.so
  libVTKPatentedPython.so

This directory is also in PYTHONPATH, LD_LIBRARY_PATH, and /etc/ld.so.conf

I set up user.make as follows:

  TCL_INCLUDE=-I/usr/include
  TCL_LIB=/usr/lib/libtcl.so

  TK_INCLUDE=-I/usr/local/src/tk8.0.3/generic
  TK_LIB=/usr/lib/libtk.so

  MESA_INCLUDE=-I/usr/include/GL
  MESA_LIB=/usr/lib/libMesaGL.so

  PYTHON_INCLUDES=-I/usr/local/src/Python-1.5.2/Include

  USER_CFLAGS = -O2 -D__NO_MATH_INLINES
  USER_CXXFLAGS = -O2 -D__NO_MATH_INLINES


Then, I configured vtk as follows:

  ./configure  --with-mesa --with-shared --with-python --with-tcl \
               --with-tkwidget --with-x --with-contrib --with-patented
  
I then did the make, which took quite a while and ran successfully,
after which I installed the libraries, ran `ldconfig -v', and then
tried the examples.  As I mentioned, every example I tried worked fine
except for the Python examples, which all give me the error I
described above.  Note that all other Python modules I have are
working perfectly, including Tkinter, Pmw, Gadfly, and many others.

Any ideas?

Thanks in advance.

-- 
 Lloyd Zusman
 ljz at asfast.com




More information about the Python-list mailing list