Regardless of platform , The elements of $env(TCLLIBPATH) should use / to separate elements with a path .
set env(TCLLIBPATH) [list /opt/tcl/site-lib /users/pat/working]
$env(TCLLIBPATH) is often not set by Tcl , and is designed to be set on a case-by-case basis depending on the needs of the site or the individual user to provide Tcl with additional site-specific locations to search for packages , or to test a package without installing it .
I like to keep all my local packages separate from the ActiveTcl installation that I use as a base. So I install all additional packages to a site-lib directory and then set $env(TCLLIBPATH) to this directory path. With this in place package require XYZ searches ActiveTcl and my site-lib directory for the most recent version of XYZ.
I download a package onto my machine. The package has a README, a demo directory, a lib directory, etc. Within the lib directory I see 3 sub-directories, and within the sub-directories are the pkgIndex.tcl file, etc.
So the basic layout is:
Installation directory/ README.txt demos/ lib/ package1/ pkgIndex.tcl package2/ pkgIndex.tcl package3/ pkgIndex.tcl src/ tests/
So, what path(s) go into TCLLIBPATH? the path to the lib/ , or each of the individual packages?
PT: the lib directory.
LV PT, thank you for the answer. I tried using that, and ran into my long time nemesis - Windows folders with spaces in the names. So eventually, when I have time, I need to change to using file join to set $env(TCLLIBPATH) rather than just hard coding it , so that it has some chance of working.
I ran git, then do 'cd' to be in HOME directory and then add file .bashrc with these lines :
$ cd $ cat .bashrc TCLLIBPATH=" . C:/Tcl/lib" export TCLLIBPATH $
Then at the next start of git, you will be able to use library packages from external (to git) Tcl installation (for instance Activestate Tcl).
Space character seems to be required at the beginning of $env(TCLLIBPATH) : you can try the following lines on command line to experience it
$ unset TCLLIBPATH $ TCLLIBPATH=". C:/Tcl/lib" $ export TCLLIBPATH $ tclsh % package require Expect can't find package Expect % exit $ TCLLIBPATH=" . C:/Tcl/lib " $ export TCLLIBPATH $ tclsh % package require Expect 5.43.2 % exit $