2

I am trying to run a very basic tcl/tk script to make a GUI and I am able to define the window using wm, however when I try to add a button using just "button" it gives me the error "invalid command name "tcl_findLibrary"". Does anyone know what is causing this? I am confident both the tcl and tk are the same version. Someone else suggested that it was a mismatch between versions so I tried having the first line in my script as:

unset env(TCL_LIBRARY)

However this did not change anything. I am writing this script on a piece of hardware that is not my own so I do not have permission to actually change the environment variables. Does anyone have any suggestions?

8
  • What version of Tcl/Tk? What platform?
    – Brad Lanam
    May 3, 2017 at 17:41
  • Both versions are 8.5.5, and it's running on OpenSuse 11.2 May 3, 2017 at 20:39
  • If it is a "very basic" script, could you just show us that script?
    – andy mango
    May 4, 2017 at 1:34
  • Sure, right now I'm just doing wm geometry . 800x800 As I said the window pops up but it throws the error tcl_findLibrary May 4, 2017 at 3:50
  • We had some previous inconclusive discussion of this problem at reddit.com/r/Tcl/comments/67sb0x/… May 4, 2017 at 9:07

2 Answers 2

1

On my Win10 machine I ran into both of these errors:

  • Can't find a usable init.tcl in the following directories ...

  • error "invalid command name "tcl_findLibrary""

The steps I ended up taking to resolve it follows. I don't know if all are needed.

  1. Search all init.tcl files for the line "package require -exact Tcl" that has the highest 8.5.x number

    1. Copy it into the first directory listed in the error messages

    2. Set the environmental variables TCLLIBPATH and TCL_LIBRARY to the directory where you found the init.tcl file

    3. Reboot

1

I also ran into both of these errors:

  • Can't find a usable init.tcl in the following directories

  • error "invalid command name "tcl_findLibrary""

I addressed the first error by searching for init.tcl file and cut the init.tcl file to the location that the program wants.

I addressed the second error by moving all file in the tcl8.6/library out to the location where you put the init.tcl at.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.