ActiveState Community

Where is Expect?

Posted by kevinw on 2006-07-12 15:33
OS: All / Any | Product: ActiveTcl | tags: activetcl expect package
Question: 

Where is Expect? Older versions of ActiveTcl had an expect executable, but the new versions don't. Where did it go? Why doesn't ActiveTcl 8.5 seem to have Expect anywhere?

Answer: 

Rather than being linked to a different interpreter, in recent versions of ActiveTcl 8.4, Expect has been made into a proper Tcl package. If you have the line:

package require Expect

In your source file before the first use of any Expect functions or variables, you can then run the file using tclsh, without having to use a special interpreter.
------------------------------------------

With ActiveTcl 8.5.x and 8.6.x there is an additional issue. In order to reduce the size of the installers, the number of extensions shipped with ActiveTcl is limited. Modules can be downloaded and installed for ActiveTcl 8.5 and 8.6 through the TEApot package manager.

The TEAPot distribution process has an additional benefit, especially important if you cannot get internet access for TEApot. It is possible to install an 8.5 release ON TOP of (into the same directory) an 8.4 release. This gives you both tclsh and tclsh8.5, wish and wish8.5, fully working demos, plus the complete set of modules shipped with 8.4 which are also all compatible with 8.5.

If you wish to have both 8.4 and 8.5:
-You MUST install 8.4 first. (If you already have 8.5 only, it should be uninstalled.)
-It is always advisable to manually delete any files left behind in the ActiveTcl install directory when changing versions.
-You MUST use a compatible pairing. The compatible pairings are:

ActiveTcl 8.4.19.1 with 8.5.3.0 to 8.5.7.0
ActiveTcl 8.4.19.0 with 8.5.2.0
ActiveTcl 8.4.18.0 with 8.5.1.0
ActiveTcl 8.4.17.0 with 8.5.0.0.283511

santhosh_kumar_d | Fri, 2008-01-04 07:01

I installed the ActiveState Tcl-8.5 in my Windows machine but could not find the Expect package anywhere. I tried giving 'package require Expect' but it gives error --> "can't find package Expect". Please tell me as to where to fetch it up from. Thanks!

astillman | Fri, 2008-01-04 08:54

I also can not find Expect in my ActiveState Tcl-8.5 distribution for Linux.
"package require Expect" returns the same error.

santhosh_kumar_d | Mon, 2008-01-07 04:10

The current ActiveTcl 8.5.0 comes with fewer default installed packages, and
you would use the "teacup" to obtain new ones. At the DOS prompt, try:

teacup install Expect

More info on the teacup is in the docs.

mikeehamm | Tue, 2008-01-08 13:45

I Installed Tcl Version 8.5 on my Windows XP PC but when I included the line, "package require Expect" into my code, an error message pops up saying "Cant find package Expect"? I uninstalled Version 8.5 and reinstalled Version 8.4.14 and the Expect package gets installed. Is there something I missed, is the Expect extension included in Version 8.5? I would like to use Version 8.5, but since I need Expect, I will have to continue to use an older version. I also tried the "teacup install Expect" as instructed in the last post, without success.

deniseshoup | Tue, 2008-01-08 14:09

I installed 8.5, and tried the "teacup install Expect", with the following result:

C:\Tcl\bin>teacup install Expect
INTERNAL ERROR ______________________
INTERNAL ERROR Shell "c:\tcl\bin\tclsh.exe" does not exist
INTERNAL ERROR while executing
INTERNAL ERROR "CHECK $shell"
INTERNAL ERROR (procedure "platform::shell::platform" line 4)
INTERNAL ERROR invoked from within
INTERNAL ERROR "# Compiled -- no source code available
INTERNAL ERROR error "called a copy of a compiled script""
INTERNAL ERROR (procedure "::repository::client::Snit_methodDoResolve" line
1)
INTERNAL ERROR invoked from within
INTERNAL ERROR "# Compiled -- no source code available
INTERNAL ERROR error "called a copy of a compiled script""
INTERNAL ERROR (procedure "::repository::client::Snit_methodResolveEntity" l
ine 1)
INTERNAL ERROR invoked from within
INTERNAL ERROR "# Compiled -- no source code available
INTERNAL ERROR error "called a copy of a compiled script""
INTERNAL ERROR (procedure "::repository::client::Snit_methodinstallEntity" l
ine 1)
INTERNAL ERROR invoked from within
INTERNAL ERROR "# Compiled -- no source code available
INTERNAL ERROR error "called a copy of a compiled script""
INTERNAL ERROR (procedure "::repository::capp::Snit_methodinstall" line 1)
INTERNAL ERROR invoked from within
INTERNAL ERROR "::capp1 install Expect"
INTERNAL ERROR ("eval" body line 1)
INTERNAL ERROR invoked from within
INTERNAL ERROR "# Compiled -- no source code available
INTERNAL ERROR error "called a copy of a compiled script""
INTERNAL ERROR ______________________

C:\Tcl\bin>

mellerbeck | Mon, 2009-03-09 10:55

I had this same error, I made sure to uninstall everything ActiveState (I had been messing with komodo edit and a different version of Active TCL)

then deleted tcl folder, and deleted shortcut from start menu (don't think that matters but did it anyways)

then rebooted then reinstalled, ActiveTcl8.5.6.0.289025-win32-ix86-threaded.exe

ran teacup install Expect

and all was good!

grahams | Tue, 2008-02-12 15:26

Under ActiveTcl 8.5.0, when teacup reports that it can't find tclsh, you can usually work around the problem by starting tclsh85 and then running teacup from inside it.
c:>\tclsh85
%teacup install Expect

grahams | Tue, 2008-02-12 15:29

If teacup reports 404 errors when installing Expect, or any other extension, it usually means that the ActiveState Teapot repository is offline for updating. This can happen any time between 4 AM and 11 AM Pacific Time. If it happens, try again in a few minutes. Generally, updates take no longer than half an hour.

mikeehamm | Tue, 2008-02-12 15:42

There should be a better way to achieve the usage of Expect with the latest release of Tcl, similar to the older versions. The issue is when trying to do a "package require Expect" from within a Tcl/Tk program in order to utilize the Expect commands, at least for my needs. If it works for the older releases, there should be an upward similarity with the newer release.

deniseshoup | Wed, 2008-02-13 09:16

I tried about a dozen times yesterday, and again this morning, and I'm still getting the 404 error. I am able to get to teapot.activestate.com via browser, and I downloaded the .zip file containing expect.tcl, expect543.dll, injector.dll, pkgIndex.tcl, and teapot.txt - can someone tell me how to install these?

jomahony | Thu, 2008-06-05 07:46

I have installed Tcl 8.5 and am having the same problems described here activating expect. It appears that to use teacup the server needs to have access to the internet. Is that correct?
If so how do I activate the expect package if the computer I wish to do this on does not have access to the internet?

b00 | Mon, 2008-11-10 23:46

I have almost the same problem. I cannot install Expect package with teacup because we have proxy auth. On this forum I have got an advise to use autoproxy with teacup, but... eventually I have not it in 8.5.5 too.

The question how to install Expect (or any other package) w/o Internet is still actual for me.

grahams | Tue, 2008-06-24 10:03

The FAQ has been updated to clarify the issue around Expect on ActiveTcl 8.5.

Muthu | Wed, 2008-11-12 06:25

Successfully installed Expect after tcl 8.5 using
teacup install Expect, as shown below:

Installing into C:/Tcl/lib/teapot

Installing package Expect 5.43 win32-ix86

Problems which occurred during the operation:
* http://teapot.activestate.com : Sizes not matching for compresse
The system used slow(er) remote queries to keep working.

issue:
when tried to give the command
"package require Expect" from tclsh85, it went in vain as:

% package require Expect
Your license file for Expect for Windows is invalid.
To purchase or upgrade a license, or to obtain a free evaluation license pleas
visit: http://www.ActiveState.com/Products/ASPN_Tcl

Email: Sales@ActiveState.com
Toll-free (North America): 1.866.866.2802
Phone: 604.484.6800
Fax: 604.484.6499

1. can anyone throw light to solve this issue?
2. tried removing & installing Expect again :(
is the above the correct way to install Expect?

looking forward to your solution.
thanks :)

mana_panigrahi | Fri, 2008-12-12 08:19

I am using Active TCL version8.5.5.When I do a "package require Expect" it shows "Can't find Expect" error.My engine needs some of the expect command to be executed.Any suggestion how to about this error.

grahams | Fri, 2009-03-20 11:58

Muthu, you have ActiveTcl 8.3 binaries in your install tree. You have to get rid of them.

The most common way this happens is installing "Expect for Windows".

"Expect for Windows" is not available on our main website because it has been discontinued for many years. "Expect for Windows" was a licensed version of Expect for use with ActiveTcl 8.3.x. When ActiveTcl 8.4 was released, Expect became free, and all further sales of new licenses for "Expect for Windows" was suspended. "Expect for Windows" remains available through alternative links as a service to the few remaining users of ActiveTcl 8.3 who have existing licenses for "Expect for Windows" and may need to re-install for some reason.

Unfortunately, installing the old "Expect for Windows" product on top of ActiveTcl 8.5 will render both products unusable.

You will need to uninstall "Expect for Windows". Then un-install ActiveTcl 8.5 (and 8.4 if you have that installed in the same directory). Finally, you must manually delete all files and folders left behind in the ActiveTcl installation directory. Then you can start to re-install. Choose one of the processes at the top of this post to get Expect in a version that will be compatible with ActiveTcl 8.5.x.