手机python没有tk模块_【IT专家】Linux Python找不到Tkinter模块

本文由我司收集整编,推荐下载,如有疑问,请与我司联系

Linux Python

找不到

Tkinter

模块

2014/12/15 0

一、安装

tkinter

Linux

python

默认是不安装

Tkinter

模块,

123456789[root@li250-193

~]#

pythonPython

2.6.6

(r266:84292,

Feb

22

2013,

00:00:18)[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2Type help , copyright , credits

or license for more information. importTkinterTraceback (most recent call last):File stdin ,

line 1,in module ImportError: No module named Tkinter

我们安装

Tkinter

模块

12345678[root@li250-193

~]#

yum

-y

install

tkinter...[root@li250-193

~]#

pythonPython 2.6.6 (r266:84292, Feb 22 2013, 00:00:18)[GCC 4.4.7 20120313 (Red Hat

4.4.7-3)]

on

linux2Type

help

,

copyright

,

credits

or

license

for

more

information.

importTkinter

二、升级

PythonLinux

Python

版本默认都不叫低

查看

Python

版本

12[root@li250-193 ~]# python -VPython 2.6.6DOWN

新版本

1[root@li250-193 ~]# wget python/ftp/python/2.7.4/Python-2.7.4.tgz

解压安装

12345678[root@li250-193 ~]# tar -xf Python-2.7.4.tgz[root@li250-193 ~]# cd Python-

2.7.4[root@li250-193

Python-2.7.4]#

./configure...[root@li250-193

Python-2.7.4]#

make...[root@li250-193 Python-2.7.4]# make install...

看看新版本

Python

是否可以使用

Tkinter

1234567891011[root@li250-193

Python-2.7.4]# ./pythonPython

2.7.4

(default,

Apr

12

2013, 08:03:09)[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2Type help , copyright ,

credits

or

license

for

more

information.

importTkinter

Traceback

(most

recent

call

last):File stdin , line 1,in module File /root/Python-2.7.4/Lib/lib-tk/Tkinter.py , line 39,in

module

import_tkinter

#

If

this

fails

your

Python

may

not

be

configured

for

TkImportError:

No

module

named

_tkinter

提示找不到

tkinter

模块?看看旧版的是不

是正常

123456[root@li250-193 Python-2.7.4]# pythonPython 2.6.6 (r266:84292, Feb 22 2013,

00:00:18)[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2Type help , copyright , credits

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值