TK_LIBRARY and TCL_LIBRARY environment variables on Ubuntu

前端 未结 1 767
被撕碎了的回忆
被撕碎了的回忆 2021-01-25 13:46

I\'m trying to get _tkinter to import into Python. I suspect it may be due to not having values defined for the environment variables TK_LIBRARY and TCL_LIBRARY. This is as it

1条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-25 14:26

    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).

    0 讨论(0)
提交回复
热议问题