Is there any way to get Python to use my ActiveTcl installation instead of having to copy the ActiveTcl libraries into the Python/tcl directory?
Asked
Active
Viewed 559 times
1 Answers
2
Not familiar with ActiveTcl, but in general here is how to get a package/module to be loaded when that name already exists in the standard library:
import sys
dir_name="/usr/lib/mydir"
sys.path.insert(0,dir_name)
Substitute the value for dir_name with the path to the directory containing your package/module, and run the above code before anything is imported. This is often done through a 'sitecustomize.py' file so that it will take effect as soon as the interpreter starts up so you won't need to worry about import ordering.

Mark Roddy
- 27,122
- 19
- 67
- 71
-
Thanks! That answers my question. I shouldn't have mentioned ActiveTcl. I just mean a regular, standalone Tcl installation. – Matt Gregory Sep 24 '08 at 23:07