Can't find package BLT

你。 提交于 2020-01-17 13:22:13

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!