Update Tcl 8.4 to Tcl 8.5: "missing" packages

Posted by dimon on 2009-07-24 01:41

I have update a Tcl 8.4.2 to 8.5.5 and TclDevKit 3.2 to TclDevKit 5.0.1.
ActiveTcl 8.5.5 installer recommends me to install Tcl 8.5.5 in the same directory with Tcl 8.4, and the TclDevKit 5.0.1 installer recommends to uninstall previous version of TclDevKit. I have done that.
My Tcl application uses several packages and works well under tcl 8.4.2. But when I try to start this application after updating Tcl, I saw an error message:
"can't find package BWidget while executing 'package require BWidget'".

I saw the same for all other 'package require' directives.
How this problem may be fixed?

With best regards, Dmitriy

ActiveState Staff
Fri, 2009-07-24 08:45

Hello Dmitriy .

While the ActiveTcl 8.5 distribution is indeed slimmed down compared to ActiveTcl 8.4 (*) BWidget is one of the packages which are still part of the distribution. I can't say anything about the other packages you tried as you don't name them.

Back to BWidget, it should have been found by 'package require'. To help us determining what is going wrong on your system I hope that you can answer a few questions.

First, using 'FOO' as the placeholder for directory you installed ActiveTcl 8.5 into, do you have a directory


on your system ? This is where ActiveTcl 8.5 puts the packages coming it.

Next, what is the output of the command

join $auto_path \n

when typed in an interactive tclsh or wish (Try both 8.4 and 8.5) ? That tells us where tclsh/wish are looking for packages.

(*) All packages P which are not in ActiveTcl 8.5 can be installed from our TEApot repository via 'teacup install P'. Or, alternatively, 'teacup update' will install everything available from the TEApot and not installed yet, or newer in our TEApot. Note however that this is unrelated to the problem you have with BWidget.

dimon | Mon, 2009-07-27 04:40

Hello Andreas and thank you for respond.
Yes, I have a directory named c:/Tcl/lib/teapot.
An output string of 'join $auto_path\n' command returns the next:

c:/Tcl/lib/tcl8.5 c:/Tcl/lib c:/tcl/lib/teapot/package/win32-ix86/lib c:/tcl/lib/teapot/package/tcl/lib
I see that the path to teapot tool folder is pesent into autopath variable. I have type that command into tclsh85 command line shell.

Than, I have look at files attentively after weekend and found my mistake! I think a mistake was linked with incorrect using of binary files. First, I saw a binary file named 'base-tk8.5-thread-win32-ix86.exe' and decided that is a Tcl 8.5 interpreter with thread support. When I rename it to 'wish85t.exe' and try to run it, a 'package require' directives give back an errors:

(bin) 1 % package require Tk 8.5
(bin) 2 % package require Thread
(bin) 3 % package require Itk 3.3
can't find package Itk 3.3
(bin) 4 % package require BWidget 1.8
can't find package BWidget 1.8
(bin) 5 %

With Wish85.exe all works correctly.

But I still have another question: what's the 'base-tk8.5-thread-win32-ix86.exe' file's purpose ?

With gratefulness, Dmitriy

ActiveState Staff
Mon, 2009-07-27 11:40

Glad to hear that your troubles are gone.

Side note: You mistyped 'join $auto_path\n'. It should have been ''join $auto_path \n'. Note the space between 'path' and '\n'.

Regarding 'base-tk...'. That is what we call a basekit, and Jean-claude Wippler calls a tclkit. It is a runtime with some packages built into it for the execution of starkits, and for use a runtime in starpacks.

An important feature of basekits, tclkits, etc. is that they modify their auto_path to search for packages _only_ inside of themselves and in the starkit they are running. (The 'star' stands for 'STand-Alone Runtime', and the restriction on the auto_path is part of that).

An introductory link is

In the context of ActiveTcl, and ActiveState, these files are for use by the Tcl Dev Kit, especially the TclApp application which can wrap your code, supporting packages and files into a single executable. Such an executable is a starpack, and has a basekit as its runtime.