问题
I am having a problem of getting BLT to work with Tcl/TK. I installed BLT library for TCL/TK but when i try running a tcl program to plot a graph, it keeps giving me an error saying "can't find package BLT". In my program I have already included:
package require BLT
I also appended the BLT part to my environmental variable on my windows operating system 32 bit but it still doesn't work.
Please what do i need to do?
回答1:
To make that work, the directory containing the BLT package needs to be on the auto_path
. Specifically, the directory that contains the directory containing the pkgIndex.tcl
file (so /foo/bar
if you put the package so that it's index file is /foo/bar/BLT/pkgIndex.tcl
) needs to be there (as Tcl looks in the directories listed and one level down). That global variable is a Tcl list of places to search; you might need to put:
lappend auto_path /foo/bar
at the beginning of your script, prior to any package require
statements. (OK, switch /foo/bar
for the real path, and use braces around it if the directory/path-element has spaces in it, as per usual Tcl quoting rules.)
来源:https://stackoverflow.com/questions/24149327/cant-find-package-blt