[vtkusers] vtk latest + vanilla python 2.2.2

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Thu Feb 13 00:50:42 EST 2003


>>>>> "MC" == Mike Carifio <carifio at usys.com> writes:

    MC> Here's the error I'm getting:

    >>>> import vtk
[snip]
    >>>>

    MC> Obviously, python 2.2.2 can't find libvtkCommonPython. There
    MC> is a vtkCommonPython.dll. When I import that, I get:

    >>>> import vtkCommonPython
    MC> Fatal Python error: Interpreter not initialized (version
    MC> mismatch?)

    MC> Am I supposed to be running a particular version of Python? Do
    MC> I need to build Python from sources to make everything kosher?

    MC> Finally, is this email list archived? I can't believe I'm the
    MC> first person to be having this problem. Thanks.

Well, several things.  We try to keep VTK-Python as up-to-date as
possible.  I test it under Linux and usually ask for feedback on Win32
since I dont run Windows.  So far we have not had this problem.

Yes, this list is archived.

  http://public.kitware.com/pipermail/vtkusers/

Yes, you are the first person to run into this and yes this is a wierd
bug.  What is happening is that your os.name is 'posix' even though
the OS you are running is win32!?  Therefore when you import vtk it
tries to import the libvtk*Python modules instead of vtkPython*.
Could you please tell us the output of this:

 python -c "import os; print os.name"

If that prints 'posix' we need another way to determine your os.
AFAIK Win32 should print either 'dos' or 'nt' and not posix.  Unless
of course, you have installed python via cygwin.  This could also
explain your version mismatch error.  If this is the case then you
should not use the DLL's that you build from VS7.  Instead you need to
build VTK from within cygwin.

If OTOH, you have installed Python for win32 you simply need to make
sure that you are using the same version of the Python interpreter
that you built your python wrappers with.  So if you have multiple
versions of Python installed on your system you need to make sure that
you build VTK-Python with the Python headers corresponding to the
Python interpreter that you plan to use to run vtk-python scripts.
You dont have to build Python from source to get everything working.

cheers,
prabhu



More information about the vtkusers mailing list