小编Mic*_*ael的帖子

Python 2.7.3无法识别Python-tk软件包

当我运行以下代码时:

import Tkinter
Run Code Online (Sandbox Code Playgroud)

我收到此错误消息:

>>> import Tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 42, in <module>
    raise ImportError, str(msg) + ', please install the python-tk package'
ImportError: /usr/lib/libtk8.5.so.0: invalid ELF header, please install the python-tk package
Run Code Online (Sandbox Code Playgroud)

但是,已安装python-tk。

$ sudo apt-get install python-tk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-tk is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Run Code Online (Sandbox Code Playgroud)

在调查失败的原因之后,我查看了Tkinter.py。这是行失败。 …

python tkinter python-2.7

5
推荐指数
1
解决办法
8978
查看次数

标签 统计

python ×1

python-2.7 ×1

tkinter ×1