Re: Can T Find Usable Init Tcl Tcllibrary

1 view
Skip to first unread message
Message has been deleted

Aquarium Morris

unread,
Jul 12, 2024, 1:02:50 PM7/12/24
to ymplasdowbu

IDLE is probably setting the path required for TCL. To find out what path is being used by IDLE, compare the output of sys.path from IDLE and without IDLE. Then you can add the location of init.tcl either using an environment variable or programatically. See Xenomorph suggestion.

Can T Find Usable Init Tcl Tcllibrary


DOWNLOAD ->>> https://picfs.com/2yV8gh



Hi,
I'm working with Linux and tcl7.6/tk4.2.
I have the following problem. It seems that I can't launch Tk in my
application. I have the following message:
tk_Init: Can't find a usable tk.tcl in the following directories:
/usr/local/lib/tk4.2/ /usr/local/lib/tk4.2
/usr/local/lib/lib/tk4.2 ./lib/tk4.2 ./tk4.2/library
/usr/local/tk4.2/library ./library
This probably means that Tk wasn't installed properly.
The tk.tcl file is present in /usr/local/lib/tk4.2/ (the first directory
checked). I think my installation of tcl/tk is quite normal. I set the
environment variables according to this installation:
TCL_LIBRARY = /usr/local/lib/tcl7.6/ (I tried both with and
TK_LIBRARY = /usr/local/lib/tk4.2/ without the last /)
I also use a LIBRARY_PATH and a LD_LIBRARY_PATH... I tried the test
suite and it is OK except for the "wm-17.1 ParseGeometry procedure". I
can run wish normally in the distribution directory as well as in my
application directory.
So, how can I get tk installed properly?
Thanks for your help,
Aline Baggio
------------------------------- Aline BAGGIO
----------------------------

Phone: 33 1 39 63 53 52 Domaine de Voluceau - BP 105
Fax: 33 1 39 63 53 72 78153 Le Chesnay Cedex - FRANCE
*-*-*.com/ aline/ Building 52, Office 06
-------------------------------------------------------------------------

Mon, 09 Oct 2000 03:00:00 GMT (Larry
#2 / 4 Problem: "Can't find a usable tk.tcl" I was getting the same problems as you until I copied the entire
tcl7.6 and tk4.2 directories (from the original Tcl/Tk install) to the
lib directory of my Tk app. After that I didn't experience the
problem. Hope this helps.
Quote:
>Hi,
>I'm working with Linux and tcl7.6/tk4.2.
>I have the following problem. It seems that I can't launch Tk in my
>application. I have the following message:
> tk_Init: Can't find a usable tk.tcl in the following directories:
> /usr/local/lib/tk4.2/ /usr/local/lib/tk4.2
>/usr/local/lib/lib/tk4.2 ./lib/tk4.2 ./tk4.2/library
>/usr/local/tk4.2/library ./library
> This probably means that Tk wasn't installed properly.
>The tk.tcl file is present in /usr/local/lib/tk4.2/ (the first directory
>checked). I think my installation of tcl/tk is quite normal. I set the
>environment variables according to this installation:
> TCL_LIBRARY = /usr/local/lib/tcl7.6/ (I tried both with and
> TK_LIBRARY = /usr/local/lib/tk4.2/ without the last /)
>I also use a LIBRARY_PATH and a LD_LIBRARY_PATH... I tried the test
>suite and it is OK except for the "wm-17.1 ParseGeometry procedure". I
>can run wish normally in the distribution directory as well as in my
>application directory.
>So, how can I get tk installed properly?
>Thanks for your help,
> Aline Baggio
>------------------------------- Aline BAGGIO
>----------------------------

> Phone: 33 1 39 63 53 52 Domaine de Voluceau - BP 105
> Fax: 33 1 39 63 53 72 78153 Le Chesnay Cedex - FRANCE
> -sor.inria.fr/aline/ Building 52, Office 06
>-------------------------------------------------------------------------

computer_2();
Mon, 09 Oct 2000 03:00:00 GMT lvir..
#3 / 4 Problem: "Can't find a usable tk.tcl"
:I was getting the same problems as you until I copied the entire
:tcl7.6 and tk4.2 directories (from the original Tcl/Tk install) to the
:lib directory of my Tk app. After that I didn't experience the
The way things have always worked for me is to do the following:
Run configure
Run make
Run make test
Run make install
What I end up with has always been a working binary. HOWEVER, I have
occasionally gotten burned by having my shell find a version of
wish or tcl in my $PATH that someone else built who didn't follow
the above.
--

O- only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.

Tue, 10 Oct 2000 03:00:00 GMT Donald G Port
#4 / 4 Problem: "Can't find a usable tk.tcl"
Quote:>> I'm working with Linux and tcl7.6/tk4.2.
>> I have the following problem. It seems that I can't launch Tk in my
>> application. I have the following message:
>> tk_Init: Can't find a usable tk.tcl in the following directories:
>> /usr/local/lib/tk4.2/ /usr/local/lib/tk4.2
>> /usr/local/lib/lib/tk4.2 ./lib/tk4.2 ./tk4.2/library
>> /usr/local/tk4.2/library ./library
>> This probably means that Tk wasn't installed properly.


Quote:> I was getting the same problems as you until I copied the entire
> tcl7.6 and tk4.2 directories (from the original Tcl/Tk install) to the
> lib directory of my Tk app.

There is a bug in the Tk_Init function in Tk version 4.2p2 for Unix, which
such copying will work around in some circumstances.
The Tk_Init function is meant to search for a tk.tcl file in the following
directories, in order:
1) The one stored in environment variable TK_LIBRARY, if any.
2) The one stored in Tcl variable tk_library, if any (usually a value
compiled into the Tk library when it is built).
3) The directory ../tk4.2 , relative to the directory returned by the
Tcl command [info library].
---> This is where the bug is in Tk 4.2 . It incorrectly looks in
---> the directory ../lib/tk4.2 relative to [info library]. Note the
---> extra '/lib' in the third directory on the list in the error message
---> above.
4) The directory ../lib/tk4.2 relative to the directory containing the
currently running executable (as returned by the Tcl command
[info nameofexecutable]).
5) The directory ../../tk4.2/library relative to the directory containing
the currently running executable.
6) The directory ../../tk4.2/library relative to the directory returned
by the Tcl command [info library].
7) The directory ../library relative to the directory containing the
currently running executable.
When you create your own C application in a directory not "parallel" to
those holding Tcl and Tk, then the paths relative to the currently running
executable (your application) 4), 5) and 7) above are not able to
locate tk.tcl (unless of course you copy all the files into your app's lib
directory as Larry describes).
However, if the person who installed Tcl/Tk followed the installation
instructions that come with it, then the value of tk_library compiled into
the Tk library matches its actual installed location and 2) above should u
still be able to locate tk.tcl . This is the meaning of the "wasn't
installed properly" message.
Even if that failed, though, tk.tcl could be found by 3) above, except for
the bug in Tk 4.2, since Aline's application is apparently able to
find the Tcl library, and assuming that Tk has at least been installed
properly relative to Tcl.
The usual workaround provided for troubles in locating the tk.tcl file is
to set the environment variable TK_LIBRARY. It's a bit of a burden on the
user, but considerably less drastic than copying the entire Tcl/Tk script
library.
If you can determine that the bug in 3) is the source for your problem,
an alternative is to stick the following code between the calls to Tcl_Init
and Tk_Init in your Tcl_AppInit function to patch over that bug without
having to modify the Tk source code:
Tcl_GlobalEval(interp,
"if [string match 7.6 $tcl_version] && ![info exists tk_library] \n\
set tk_library [file join [file dirname $tcl_library] tk4.2]\n\
Quote:");

Unfortunately, none of this discussion explains Aline's problem. Aline
did set TK_LIBRARY, and reported that tk.tcl is in fact in one of the
directories that is reported to have been searched in the error message,
yet the error is still reported. The only thing which comes to mind
is that the word 'usable' in the error message is carefully chosen.
It could be that the application is able to find the tk.tcl file,
but that an error occurs when it is evaluated. It wasn't until Tk 8.0,
that the Tk_Init function was enhanced to report such errors to the
user. If upgrading is an option, it would be a good idea.
--
Don Porter, D.Sc. Mathematical and Computational Sciences Division

NIST
______________________________________________________________________

Tue, 10 Oct 2000 03:00:00 GMT Page 1 of 1
[ 4 post ] Relevant Pages 1. Can't find a usable tk.tcl

Second, the Tcl and Tk shared libraries will look for a bunch of initialization and other scripts which were installed as part of ActiveTcl. The best way to specify where to find them is to set the TCL_LIBRARY and TK_LIBRARY system environment variables.

aa06259810
Reply all
Reply to author
Forward
0 new messages