Pmw blt problem

Gary Richardson garyr at
Sun Sep 2 03:48:53 CEST 2001

This code fragment (from Pmw.Blt documentaion):

from Tkinter import *
import Pmw
master = Tk()
if not Pmw.Blt.haveblt(master):     # is Blt installed?
   print("BLT is not installed!")
    g = Pmw.Blt.Graph( master )
    g.pack( expand=1, fill='both' )
    vector_x = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
    vector_y = (5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5)
    g.line_create( "f(x)=abs(x-5)", xdata=vector_x, ydata=vector_y )

works, but only once. If I attempt to run it a second time I get the
Traceback (most recent call last):
  File "C:\Python21\Pythonwin\pywin\framework\", line 301, in
    exec codeObject in __main__.__dict__
  File "C:\My Documents\Python\Blt\", line 8, in ?
    g = Pmw.Blt.Graph( master )
  File "c:\python21\Pmw\Pmw_0_8_5\lib\", line 260, in __init__
    Tkinter.Widget.__init__(self, master, _graphCommand, cnf, kw)
  File "c:\python21\lib\lib-tk\", line 1758, in __init__
TclError: invalid command name "::blt::graph"

This also happens if I run Python from a DOS prompt. In both cases I have to
exit Python and start over.

Here is what I did to install BLT (based on several posts to c.l.p):

1) Installed BLT in the c:\python21\tcl directory as c:\python21\tcl\blt...

2) Moved the blt dll's (BLT24.dll, BLTlite24.dll) to c:\windows\system and
the blt lib files (BLT24.lib, BLTlite24.lib) to c:\python21\tcl

3) Copied the c:\python21\tcl\blt\lib\blt2.4 directory to

I found a post to c.l.p on 29 March 01 describing the this same problem but
there were no replies. Can someone tell me what I've done wrong or what
the fix is?

I'm using the PythonWin IDE, ActivePython build 2.1.211.

Thanks in advance
Gary Richardson

More information about the Python-list mailing list