[vtkusers] Vtk 6.1 Standalone Python Interface (Installer) Windows pyd files in wrong location

diego0020 da.angulo39 at uniandes.edu.co
Fri Jan 10 14:41:11 EST 2014


Thanks for your reply

I found some other problems when trying to use Tkinter using the installer.
I tried with the included interpreter and with the offiial python
interpreter

Using the included interpreter, when I type 
>>> import vtk
>>> from vtk.tk.vtkTkRenderWindowInteractor import 
>>> vtkTkRenderWindowInteractor

It fails with the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files (x86)\VTK
6.1.0-RC1\lib\site-packages\vtk\tk\vtkTkRenderWindowInteractor.py", line 12,
in <module>
    import Tkinter
  File "C:\Program Files (x86)\VTK 6.1.0-RC1\bin\lib\lib-tk\Tkinter.py",
line 39, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter

I think the problem is in the file FixTk.py, whih tries to look for tk
inside
sys.prefix = 'C:\\Program Files (x86)\\VTK 6.1.0-RC1\\bin'

But I couldn't understand it very well

========================================================

-Using the official interpreter with the installer's bin directory in PATH
and with
PYTHONPATH=C:\Program Files (x86)\VTK 6.1.0-RC1\bin;C:\Program Files
(x86)\VTK 6.1.0-RC1\lib\site-packages
>> import vtk
>> from vtk.tk.vtkTkRenderWindowInteractor import 
>> vtkTkRenderWindowInteractor

works now, but when I attempt to call
>> render_widget = vtkTkRenderWindowInteractor(top ,width=600, height=600)
I get the following error 

TclError                                  Traceback (most recent call last)
<ipython-input-8-75725e72815c> in <module>()
      1 render_widget = vtkTkRenderWindowInteractor(top
      2                                             ,width=600,
----> 3                                             height=600)

C:\Program Files (x86)\VTK
6.1.0-RC1\lib\site-packages\vtk\tk\vtkTkRenderWindowInteractor.py in
__init__(self, master, cnf, **kw)
     46         """
     47         # load the necessary extensions into tk
---> 48         vtkLoadPythonTkWidgets(master.tk)
     49 
     50         try: # check to see if a render window was specified

C:\Program Files (x86)\VTK
6.1.0-RC1\lib\site-packages\vtk\tk\vtkLoadPythonTkWidgets.pyc in
vtkLoadPythonTkWidgets(interp)
     71 
     72     # re-generate the error
---> 73     interp.call('load', filename, pkgname)

TclError: couldn't load library "vtkRenderingPythonTkWidgets-6.1.dll": this
library or a dependent library could not be found in library path


I checked, and in fact the file "vtkRenderingPythonTkWidgets-6.1.dll" is not
included in the installer. This file is however built when generating vtk
from source. When I built from source I used tck/tk version 8.5.

I did the experiment of copying "vtkRenderingPythonTkWidgets-6.1.dll" from
my source build to the installer's bin directory and it worked!!!

============================

A complete example of vtk and tkinter can be found in 
http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/GUI/Python/ImagePlaneWidget.py

Thanks for all the hard work, and please let me know if there is something
else I can do to help

best regards





--
View this message in context: http://vtk.1045678.n5.nabble.com/Vtk-6-1-Standalone-Python-Interface-Installer-Windows-pyd-files-in-wrong-location-tp5725312p5725321.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list