IDLE 无法导入 Tkinter.您的Python可能未配置为Tk [英] IDLE can't import Tkinter. Your Python may not be configured for Tk

查看:322
本文介绍了IDLE 无法导入 Tkinter.您的Python可能未配置为Tk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Ubuntu 10.10,并且今天已经安装了Python 3.2.系统已经在运行Python 2.6.

I am running Ubuntu 10.10, and I installed Python 3.2 today. The system is already running Python 2.6.

我在终端中输入了idle3.2,它给了我

I typed idle3.2 in the terminal and it gave me:

IDLE无法导入Tkinter.您的Python可能未配置为Tk.

IDLE can't import Tkinter. Your Python may not be configured for Tk.

所以我在 Stack Overflow (以及其他地方)上搜索了一个解决方案,我安装了 python-tk ,然后重新检查我是否有 tclsh 在系统上,但我仍然无法打开 idle3.2.

So I searched on Stack Overflow (and in some other places) for a solution, I installed python-tk, I rechecked that I have tclsh on the system, but I still can't manage to open idle3.2.

任何输入将不胜感激.

推荐答案

在OSX上,可以通过安装适用于您的python版本的python tkinter软件包,使用macports解决此问题.就我而言,使用python 2.7,我在终端上运行:

On OSX, this can be resolved with macports by installing the python tkinter package for your python version. In my case, with python 2.7, I ran on the terminal:

sudo port install py27-tkinter

将"27"更改为您的python版本号.

change the "27" to your python version number.

这篇关于IDLE 无法导入 Tkinter.您的Python可能未配置为Tk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆