WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1  
Old 06-23-2003, 10:27 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Tk with Vizard

This thread explains how to use Tk with Vizard

Step 1:

Download the following file to your computer:

tkinter.zip

Step 2:

Open the file with Winzip or a similar program. Extract the contents of the zip file to [VIZARD_PATH]\bin\ where [VIZARD_PATH] is the location of your Vizard installation (usually C:\Program Files\Vizard).

That's it, Tk should now work with Vizard. If you have any problems please post them here.

-- Farshid
Reply With Quote
  #2  
Old 06-23-2003, 12:08 PM
sled sled is offline
Member
 
Join Date: Jun 2003
Posts: 31
Thank you for your help , but it still can not work,the message as following.
Traceback (most recent call last):
File "<string>", line 1, in ?
File "C:\Documents and Settings\Administrator\Desktop\gv10.weigang\weigan gGUI.
py", line 2, in ?
from tkFileDialog import *
File "C:\Program Files\Vizard\bin\lib\tkFileDialog.py", line 39, in ?
from tkCommonDialog import Dialog
File "C:\Program Files\Vizard\bin\lib\tkCommonDialog.py", line 15, in ?
from Tkinter import *
File "C:\Program Files\Vizard\bin\lib\Tkinter.py", line 35, in ?
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: DLL load failed: The specified module could not be found.
Reply With Quote
  #3  
Old 06-23-2003, 12:16 PM
sled sled is offline
Member
 
Join Date: Jun 2003
Posts: 31
my file is attached, it works properly in pythonwin, but when I invoke some viz method , it 's dead.
Attached Files
File Type: zip weiganggui.zip (843 Bytes, 2086 views)
Reply With Quote
  #4  
Old 06-23-2003, 12:34 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

I tested out your script and it worked fine on my machine. Did you try restarting Vizard after you copied the tkinter files to your computer?

-- Farshid
Reply With Quote
  #5  
Old 06-23-2003, 12:38 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi again,

I just realized that I made a mistake. There are two files that are copied to the [VIZARD_PATH]\bin\lib directory that should go to the [VIZARD_PATH]\bin\DLLs directory instead. The two files are:

tk83.dll
tcl83.dll


Just take those files out of the lib directory and put them in the DLLs directory, then restart Vizard. Sorry about that.

-- Farshid
Reply With Quote
  #6  
Old 06-23-2003, 04:13 PM
sled sled is offline
Member
 
Join Date: Jun 2003
Posts: 31
thanks a lot and sorry to bother you again, the tk gui works well in vizard now , but when I begin to invoke the viz.add(...) by click the start button,it shows err message:

Traceback (most recent call last):
File "<string>", line 1, in ?
File "weigangGUI.py", line 58, in ?
root = Tk()
File "C:\Program Files\Vizard\bin\lib\Tkinter.py", line 1483, in __init__
baseName = os.path.basename(sys.argv[0])
AttributeError: 'module' object has no attribute 'argv'
Reply With Quote
  #7  
Old 06-23-2003, 04:21 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

This is a problem we've encountered before and has already been resolved in the latest version. At the top of your script you need to issue the following commands:

import sys
sys.argv = [''] (Note: those are two single quotes)

That should do it, but please let me know if it doesn't work.

-- Farshid
Reply With Quote
  #8  
Old 06-23-2003, 07:14 PM
sled sled is offline
Member
 
Join Date: Jun 2003
Posts: 31
Talking

oh, it works well, thanks a lot.
Reply With Quote
  #9  
Old 02-04-2004, 08:32 PM
softscan softscan is offline
Member
 
Join Date: Oct 2003
Location: Newcastle, Australia
Posts: 9
I have just installed ActiveStates PythonWin IDE whic goes into C:/Python2.3 by deault.Will this work OK with VIzard or do I need to set paths. If so what?
HOpe this is OK in thi thread.
Thanks
Johnny K
Reply With Quote
  #10  
Old 02-05-2004, 09:41 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

You will need to add the following directories to your python path in order to get Vizard working:

[Vizard20]/
[Vizard20]/python/

That should be it. Are you planning on using Tk?
Reply With Quote
  #11  
Old 09-10-2004, 01:02 PM
jrodman jrodman is offline
Member
 
Join Date: Jun 2003
Posts: 21
tkinter stopped working

I had tk working with Vizard, and at some point in the last few months it stopped working. I tried everything suggested in this thread.

It gives the following error message:
File "C:\Program Files\Vizard20\bin\lib\Tkinter.py", line 35, in ?
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: DLL load failed: The specified module could not be found.
Reply With Quote
  #12  
Old 09-10-2004, 01:40 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Try downloading and reinstalling the tkinter.zip file. Vizard recently switched from python 2.2 to 2.3, and the tkinter files were not updated. Let me know if this fixes it.
Reply With Quote
  #13  
Old 09-15-2004, 11:16 AM
jrodman jrodman is offline
Member
 
Join Date: Jun 2003
Posts: 21
I tried the new tkinter.zip file. It still gives the same error.

Any other ideas?
Reply With Quote
  #14  
Old 09-15-2004, 11:25 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

You need to uninstall the previous version of Tk first. Delete the following files from the C:\Program Files\Vizard20\bin\lib directory:

Canvas.py
Dialog.py
FileDialog.py
FixTk.py
ScrolledText.py
SimpleDialog.py
Tix.py
tkColorChooser.py
tkCommonDialog.py
Tkconstants.py
Tkdnd.py
tkFileDialog.py
tkFont.py
Tkinter.py
tkMessageBox.py
tkSimpleDialog.py
turtle.py

Also, delete the following directories:

C:\Program Files\Vizard20\bin\lib\tcl8.3
C:\Program Files\Vizard20\bin\lib\tk8.3
Reply With Quote
  #15  
Old 07-11-2007, 01:45 PM
jrodman jrodman is offline
Member
 
Join Date: Jun 2003
Posts: 21
tkinter is not working for me with Vizard 3.0.

I'm getting the same error message as before:
from Tkinter import *
File "C:\Program Files\WorldViz\Vizard30\bin\lib\lib-tk\Tkinter.py", line 38, in ?
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter

It looks like Vizard upgraded from Python 2.3 to 2.4. Does that mean we need new tkinter files?
Reply With Quote
  #16  
Old 07-11-2007, 01:48 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Have a look at the Vizard downloads page. Under the "Vizard 3.0 Addons" section there is an installer that adds the necessary Tkinter files to your Vizard 3.0 installation.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:50 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC