[英]Python 2.6.6 and tkinter module
I need to run an application written in python. 我需要运行一个用python编写的应用程序。 When I try to load it from terminal I get this error: 当我尝试从终端加载它时,出现此错误:
File "/usr/local/bin/soar", line 3, in <module>
import form.main
File "/usr/local/lib/python2.6/site-packages/form/main.py", line 14, in <module>
from Tkinter import *
File "/usr/local/lib/python2.6/lib-tk/Tkinter.py", line 39, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter
I installed python 2.6.6 from the source files. 我从源文件安装了python 2.6.6。 I am really confused!! 我真的很困惑!
How should I install tkinter? 我应该如何安装tkinter?
I am running Xubuntu 13.10. 我正在运行Xubuntu 13.10。 You can see the different versions of python already installed in the below: 您可以在下面看到已经安装的不同版本的python:
How can I remove python2.6.6? 如何删除python2.6.6? I tried to remove all files and folders related to python2.6. 我试图删除所有与python2.6相关的文件和文件夹。 Now when I run python, it still loads python 2.6.6 I really have no idea what to do!! 现在,当我运行python时,它仍然会加载python 2.6.6,我真的不知道该怎么做! I tried to follow the instructions here and here to uninstall it but it did not work, that's why I deleted all the files and folders manually. 我尝试按照此处和此处的说明进行卸载,但无法正常工作,这就是为什么我手动删除了所有文件和文件夹的原因。
Type the following in your terminal: 在终端中输入以下内容:
sudo apt-get install python-tk
Install python3-tk
package if you need Tkinter functionality in the 3rd version of python. 如果您需要第3版python中的Tkinter功能,请安装python3-tk
软件包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.