简体   繁体   English

如何在Ubuntu 9.04上为tkinter设置pythonpath(python2.6)(使用nltk)?

[英]How to set pythonpath (python2.6) for tkinter on Ubuntu 9.04 (to use nltk)?

I'd like to use the nltk toolkit on my machine which runs Ubuntu 9.04. 我想在运行Ubuntu 9.04的计算机上使用nltk工具包。 I installed python 2.6.4 and several additional packages (numpy, scipy, matplotlib and of course nltk). 我安装了python 2.6.4和几个其他软件包(numpy,scipy,matplotlib,当然还有nltk)。 I can import nltk, but calling a few methods gives various error masseges, all contain "please install Tkinter library". 我可以导入nltk,但是调用一些方法会导致各种错误,它们都包含“请安装Tkinter库”。 Googling around I discovered from http://wiki.python.org/moin/TkInter that I should set my pythonpath environment variable. 我从http://wiki.python.org/moin/TkInter到处搜寻,我应该设置pythonpath环境变量。 However I couldn't find out how to do this after searching for hours. 但是,搜索了几个小时之后,我无法找到如何执行此操作的方法。

Sounds like you forgot to install the appropriate TkInter when you installed Python 2.6.4. 听起来好像您在安装Python 2.6.4时忘记了安装适当的TkInter。 Install it from the same source. 从同一源安装它。

Tkinter is usually included with the python standard libraries but Ubuntu left it out of the regular python package. Tkinter通常包含在python标准库中,但是Ubuntu将其排除在常规python软件包之外。 You just need to install the python-tk package. 您只需要安装python-tk软件包。

sudo apt-get install python-tk

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM