Le 11 juin 2010 à 21:11, Martin Costabel a écrit :

> Miguel Ortiz Lombardia wrote:
>> Hi all,
>> I want to use the python wrappers for vtk.
>> I installed vtk54, vtk54-shlibs and vtk54-dev, but they don't include the 
>> wrappers. So I went on and installed pyvtk-py25.
>> But then I face this problem:
>> (A)> /sw64/bin/python2.5
>> Python 2.5.5 (r255:77872, May 15 2010, 03:23:49) [GCC 4.2.1 (Apple Inc. 
>> build 5646) (dot 1)] on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import vtk
>> Fatal Python error: Interpreter not initialized (version mismatch?)
>> Abort trap
>> This is on:
>> OSX 10.6.3 (64bit)
> 
> The only vtk version in Fink with which you can run "import vtk" from python 
> is vtk54-cocoa on OSX 10.6. This package uses the system /usr/bin/python2.6 
> and installs its vtk python bindings into /sw/Library/Python/2.6/site-packages
> 
> That "import vtk" does not work with python versions 2.4 and 2.5 is an 
> annoying "feature" of python. I have not found a way to link the vtk python 
> plugins in such a way that this would work. Note that the "version mismatch" 
> message is nonsense. The version is the right one, python2.5 just does not 
> like that the modules are linked with libpython2.5.dylib.
> 
> The python stuff in vtk does work, however, if one runs the "vtkpython" 
> binary instead of the python2.5 interpreter.
> 
> I guess what all this means is that I (or someone else?) should make a pyvtk 
> version that runs with vtk54-cocoa (or rather some vtk56 variant). But there 
> are just too many versions of python, vtk, and MacOSX around right now. I 
> think I will have time and energy to clean up this and others of my fink 
> packages only after we definitely ditch OSX 10.4 and get rid of python <=2.5 
> and anything that depends on it.
> 
> -- 
> Martin

Hi Martin,

Thanks a lot for your message! I understand what you mean, I think you're 
right, too many versions of python and OSX around.

I need the X11 version, so I cannot use vtk54-cocoa. However, using vtkpython 
to call the program I wanted to run did the trick! I first went into yet 
another problem, though:

  File "/sw64/lib/python2.5/site-packages/vtk/tk/vtkLoadPythonTkWidgets.py", 
line 54, in vtkLoadPythonTkWidgets
    if len(path) > 0 and path[0] == '{' and path[-1] == '}':
TypeError: object of type '_tkinter.Tcl_Obj' has no len()

But I found that modifying line 57 in 
/sw64/lib/python2.5/site-packages/vtk/tk/vtkLoadPythonTkWidgets.py from:

        except AttributeError:

to

        except: #AttributeError:

seems to safely solve the problem in my case (Tkinter paths can be ignored in 
this case since the all the libraries needed are in /sw64/lib/vtk54). This 
trick had been reported here: 
http://old.nabble.com/broken-vtkTkRenderWindowInteractor.py-in-5.2.0--td19263141.html

AFAIK, this problem should be solved in vtk-5.6

Thanks again, I have finally managed to see the program that needed vtk running!

Best wishes,


-- Miguel

Architecture et Fonction des Macromolécules Biologiques (UMR6098)
CNRS, Universités d'Aix-Marseille I & II
Case 932, 163 Avenue de Luminy, 13288 Marseille cedex 9, France
Tel: +33(0) 491 82 55 93
Fax: +33(0) 491 26 67 20
e-mail: [email protected]



Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Fink-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to