can't find package FileLib
typical TCL "package" horror
# I know finally the "autopath" is the WRONG name
lappend autopath /some/path/to/package/dir
package require FileLib
can't find package FileLib
while executing
"package require FileLib"
----
â go into the directory
sbin> cat pkgIndex.tcl
package ifneeded FileLib 2.0 [list source [file join $dir FileLib.tcl]] package ifneeded StdLib 2.0 [list source [file join $dir StdLib.tcl]]
----
â try to debug, add "set tcl_traceExec 1"
â get a lot of "nonsens" (important info cut away)
Calling proc "::unknown" "::tcl::tm::Unkn..." "::tclPkgUnknown" "FileLib" "0-"
Calling proc "auto_load" "::tcl::tm::Unkn..." "::"
Calling proc "auto_qualify" "::tcl::tm::Unkn..." "::"
Calling proc "auto_load_index"
Calling proc "::tcl::tm::Defa..."
Calling proc "roots" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "add" "/home/dev1usr/e..."
Calling proc "::tcl::tm::Unkn..." "::tclPkgUnknown" "FileLib" "0-"
Calling proc "::unknown" "::tclPkgUnknown" "FileLib" "0-"
Calling proc "auto_load" "::tclPkgUnknown" "::"
Calling proc "auto_qualify" "::tclPkgUnknown" "::"
Calling proc "::tclPkgUnknown" "FileLib" "0-"
Calling lambda "apply" "{dir} {\n se..." "/home/dev1usr/e..."
can't find package FileLib
while executing
"package require FileLib"
---
call: man n package
â check for the term "path" â not found in manpage
â a lot of text but NOT a single word how to setup the path to get the package found !!
----
after some research the right name is "auto_path"
mfg ao
At Fri, 21 Jun 2024 11:40:25 +0200 aotto1968 <aotto1968@t-online.de> wrote:
typical TCL "package" horror
# I know finally the "autopath" is the WRONG name
lappend autopath /some/path/to/package/dir
The correct name is auto_path. The docs say so:
auto_path
If set, then it must contain a valid Tcl list giving directories
to search during auto-load operations (including for package inâ€Â
dex files when using the default package unknown handler). This
variable is initialized during startup to contain, in order: the
directories listed in the TCLLIBPATH environment variable, the
directory named by the tcl_library global variable, the parent
directory of tcl_library, the directories listed in the tcl_pkgâ€Â
Path variable. Additional locations to look for files and packâ€Â
age indices should normally be added to this variable using lapâ€Â
pend.
Additional variables relating to package management exist. More
details are listed in the VARIABLES section of the library manâ€Â
ual page.
Where did you see "autopath"?
the core problem is *not* the "autopath" is wrong because at the time I use it I
does not know it was wrong. The core problem is that is was *very* difficult to figure
out what was the "right" name. special the tcl_traceExec… does not help and more
important the package.n docu (package require…) does *not* spend a single word on
*how* to find a package.
On 6/21/2024 1:17 PM, aotto1968 wrote:
snip
the core problem is *not* the "autopath" is wrong because at the
time I use it I does not know it was wrong. The core problem is
that is was *very* difficult to figure out what was the "right"
name. special the tcl_traceExec… does not help and more important
the package.n docu (package require…) does *not* spend a single word
on *how* to find a package.
I'm not sure if this would have helped in your case, but I've used
this with some success. It outputs every package command issued and
by using a search pattern to limit the output to the ifneeded
commands, sometimes gets me what I need to know.
et99 <et99@rocketship1.me> wrote:
On 6/21/2024 1:17 PM, aotto1968 wrote:
snip
the core problem is *not* the "autopath" is wrong because at the
time I use it I does not know it was wrong. The core problem is
that is was *very* difficult to figure out what was the "right"
name. special the tcl_traceExec… does not help and more important
the package.n docu (package require…) does *not* spend a single word
on *how* to find a package.
So the least disruptive change to cover aotto1968's complaint would be
for aotto1968 to file a patch against the package man page adding a
"see tcl_library manpage for Tcl special variables related to package handling".
That, or aotto1968 should file a patch against the package namespace to
add a brief paragraph to the package manpage detailing that the special global auto_path contains a list of directories within which to search
for packages when doing a package require.
Either of the above would be a proactive step to eliminate the problem.
et99 <et99@rocketship1.me> wrote:
On 6/21/2024 1:17 PM, aotto1968 wrote:
snip
the core problem is *not* the "autopath" is wrong because at the
time I use it I does not know it was wrong. The core problem is
that is was *very* difficult to figure out what was the "right"
name. special the tcl_traceExec⦠does not help and more important
the package.n docu (package requireâ¦) does *not* spend a single word >> on *how* to find a package.
I'm not sure if this would have helped in your case, but I've used
this with some success. It outputs every package command issued and
by using a search pattern to limit the output to the ifneeded
commands, sometimes gets me what I need to know.
aotto1968's complaint is that the "package" man page does not mention
that the auto_path variable stores the search path list for finding
packages. And, I looked, it does not make any mention of the
"specialness" of that variable.
On my Slack15 install, all of the Tcl special variables are documented
in a man page named "tcl_library" (although the page contents believes
it is named "tclvars"). So auto_path's specialness /is/ documented,
but unless one has discovered that it is documented in a different
manpage from 'package', one could very well spend a lot of time and not
find the proper docs.
So the least disruptive change to cover aotto1968's complaint would be
for aotto1968 to file a patch against the package man page adding a
"see tcl_library manpage for Tcl special variables related to package handling".
That, or aotto1968 should file a patch against the package namespace to
add a brief paragraph to the package manpage detailing that the special global auto_path contains a list of directories within which to search
for packages when doing a package require.
Either of the above would be a proactive step to eliminate the problem.
Grumbling on Usenet about the issue is not taking any direct steps to proactively eliminate the issue.
At Fri, 21 Jun 2024 21:55:54 -0000 (UTC) Rich <rich@example.invalid> wrote:
et99 <et99@rocketship1.me> wrote:
On 6/21/2024 1:17 PM, aotto1968 wrote:
snip
the core problem is *not* the "autopath" is wrong because at the
time I use it I does not know it was wrong. The core problem is
that is was *very* difficult to figure out what was the "right"
name. special the tcl_traceExec?????? does not help and more important >> >> the package.n docu (package require??????) does *not* spend a single word >> >> on *how* to find a package.
I'm not sure if this would have helped in your case, but I've used
this with some success. It outputs every package command issued and
by using a search pattern to limit the output to the ifneeded
commands, sometimes gets me what I need to know.
aotto1968's complaint is that the "package" man page does not mention
that the auto_path variable stores the search path list for finding
packages. And, I looked, it does not make any mention of the
"specialness" of that variable.
On my Slack15 install, all of the Tcl special variables are documented
in a man page named "tcl_library" (although the page contents believes
it is named "tclvars"). So auto_path's specialness /is/ documented,
but unless one has discovered that it is documented in a different
manpage from 'package', one could very well spend a lot of time and not
find the proper docs.
So the least disruptive change to cover aotto1968's complaint would be
for aotto1968 to file a patch against the package man page adding a
"see tcl_library manpage for Tcl special variables related to package
handling".
I suspect that the tcl_library manpage is replicated from the tclvars man page.
can't find package FileLib
while executing
"package require FileLib"
can't find package FileLib
while executing
"package require FileLib"
checked the tcl variable "tcl_pkgPath" filled with:
...
checked the tcl variable "auto_path" filled with:
...
checked the environment variable "TCLLIBPATH" filled with:
...
read more about package path lookup at:
...
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 498 |
Nodes: | 16 (2 / 14) |
Uptime: | 44:13:53 |
Calls: | 9,800 |
Calls today: | 2 |
Files: | 13,752 |
Messages: | 6,189,748 |