TK_LIBRARY and TCL_LIBRARY environment variables on Ubuntu
I'm trying to get _tkinter to import into Python. I s开发者_运维技巧uspect it may be due to not having values defined for the environment variables TK_LIBRARY and TCL_LIBRARY. This is as it stands after using apt-get for python-tk, tcl, and tk. If I have to set the environment variables manually, what would I set them to?
I am using Ubuntu 10.10 and Python 2.5.5.
No, setting TK_LIBRARY and TCL_LIBRARY should not be necessary. I suspect you are invoking a Python interpreter different from /usr/bin/python
, or /usr/bin/python
has been changed to point to a different Python interpreter than the one that goes with the python-tk
package. Ubuntu 10.10 ships with Python 2.6 by default.
Edit: To build Python 2.5 with Tk support, make sure the tk-dev package is installed before running configure. Also check the end of the build output what other modules have not been built, and consider installation the relevant header files. Make sure that your installation does not overwrite /usr/bin/python, e.g. by installing into /usr/local (which is the default for configure).
精彩评论