When the environment variable TCL_LIBRARY is defined, Tcl's default initialization sequence takes its value to be a file system directory in which the init.tcl file should be sought first. In a proper Tcl installation, use of this environment variable should not be needed. The main use for it is in Tcl's own build and test procedures to direct initialization of a freshly built Tcl program so that it can be tested before it is installed. Other than that, it should be considered a tool for "last-resort" workarounds of broken installations, not a tool for routine use.

If what you are trying to do is set an environment variable to point to directories containing other Tcl packages, check TCLLIBPATH.

Note that the tclkit program customizes the Tcl initialization process such that the environment variables TCL_LIBRARY and TCLLIBPATH have no effect. [L1 ].

Note more generally that programs which embed the Tcl library may or may not be influences by these environment variables depending on the details of how those programs initialize it. Some programs may not call Tcl_Init() at all. Others may call a customized version of it.

See also magic names and tclvars.