安装Idle3.6时出错

时间:2017-05-02 19:21:33

标签: python linux python-3.x tkinter python-idle

我正在运行Linux Mint 18.1和python 3.6。

我想在安装this package

之后安装idle3.6

我收到以下错误:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/idlelib/pyshell.py", line 4, in 
<module>
from tkinter import *
File "/usr/local/lib/python3.6/tkinter/__init__.py", line 36, in 
<module>
import _tkinter # If this fails your Python may not be configured for 
Tk
ModuleNotFoundError: No module named '_tkinter'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/idle3.6", line 3, in <module>
from idlelib.pyshell import main
File "/usr/local/lib/python3.6/idlelib/pyshell.py", line 7, in 
<module>
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
NameError: name 'sys' is not defined

我的理解是我需要安装tkinter包。

我到目前为止尝试的是这个命令:

sudo apt-get install python3-tk

但我仍然遇到上述错误。

我应该使用哪个命令为python 3.6安装tkinter?

1 个答案:

答案 0 :(得分:1)

这是一个Linux Mint IDLE版本:https://community.linuxmint.com/software/view/idle-python3.5,因为您使用的是Linux Mint。还没有一个idle-python3.6版本。