Help getting BLT extension working with python/tkinter on linux

Bob bobt at
Mon Jun 16 23:33:36 CEST 2003

I'm confused about how to get the BLT package configured and working on
linux. Here's my situation:

I have ActivePython installed, version 2.2. This includes tkinter and some
other extensions, but since it doesn't have a complete tcl/tk installation
I couldn't build other extensions against it. So I downloaded ActiveTCL,
version I believe (it has the same versions of tcl/tk as the

When I wanted to use the Tktable extension I compiled and installed it
into the ActiveTcl hierarchy. To use it from Python, I simply went to
/usr/local/ActivePython2.2/lib and made a symlink:

  Tktable -> /usr/local/ActiveTcl/lib/Tktable2.7/

and put the wrapper in

It all worked fine.

So now for BLT, I downloaded the source, and built and installed it into
ActiveTcl. I made a link in /usr/local/ActivePython2.2/lib:

  BLT -> /usr/local/ActiveTcl/lib/blt2.4/

but I can't get this extension to load manually:

  % python
  ActivePython 2.2.1 Build 222 (ActiveState Corp.) based on
  Python 2.2.1 (#1, Apr 15 2002, 12:31:31) 
  [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> from Tkinter import *
  >>> w = Tk()
  >>>'package', 'require', 'BLT')
  Traceback (most recent call last):
    File "<stdin>", line 1, in ?
  TclError: couldn't load file "/usr/local/ActiveTcl/lib/": /usr/local/ActiveTcl/lib/ undefined symbol: TclpAlloc

This tells me that the BLT extension was found ok, but the actual dynamic
loading of the library failed because it couldn't find the symbol TclpAlloc.

That's a basic allocation routine in the tcl library, This
symbol is found in python2.2/lib-dynload/, so why can't the blt
library find it?

In general, what is the best way to use python and tkinter, with the ability
to compile your own extensions? Should I punt on ActiveState's
distributions and download python and tcl/tk myself, and build it from
scratch? I work with tcl/tk too, so it would be nice if I could build the
extension once and have it work correctly in both worlds.



More information about the Python-list mailing list