Use teacup to install Tcl's math packages on Ubuntu
Download ActiveTcl from ActiveState
ActiveTcl provides teacup, which is a client for the TEApot package server. The Tclers wiki provides much more information about all this.
I unpack the downloaded file in some temporary directory. There's an install.sh file in the root of the unpacked archive.
$ sudo ./install.sh
...will start the graphical installer. I just accept the default
/opt/ActiveTcl-8.6
installation directory and accept all the terms.
View the available packages list
With the default installation directory, I need to be root to use teacup. I also need to add it to my path.
$ sudo su
# PATH=/opt/ActiveTcl-8.6/bin:$PATH
# teacup list
See the edit below for more about problems with permissions.
Install your package
I want to install math::statistics
, so
# teacup install math::statistics
<snip>
Retrieving package math::statistics 1.0 tcl ...@ http://teapot.activestate.com ... Ok
Installing into /opt/ActiveTcl-8.6/lib/teapot
Installing package math::statistics 1.0 tcl
Check your work
Start tclsh to make sure you can require math::statistics as an ordinary user.
# exit
$ PATH=/opt/ActiveTcl-8.6/bin:$PATH
$ tclsh
% package require math::statistics
1.0
...and that's success! Of course, you can make your life easier by adding the PATH command to your .bashrc or .bash_profile script.
Edit on Saturday, September 24, 2016
I could not install ActiveTcl in a way that allowed an ordinary
user to use teacup. I tried installing everything into
/home/john/opt
instead of /opt
, but teacup then created a
~/.teapot
directory owned by root. So I guess users of "locked
down" systems will need to find another way to get the packages they
need.