#备忘
查看后端后 发现是agg
import tkinter 发现不行
find /usr -name *tkinter.so 发现有tkinter 原来是python2.6和python2.7起冲突了
[root@li250-193 Python-2.7.4]
# vim Modules/Setup.dist
|
找到下面这几行,把前面的井号去掉打开它
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \-L/usr/local/lib \-I/usr/local/include \-ltk8.5 -ltcl8.5 \-lX11
tk8.5 -ltcl8.5 默认是 8.2 ,请你系统实际tcl/tk版本修改
1
2
3
4
5
|
[root@li250-193 Python-2.7.4]
# rpm -qa | grep ^tk
tk-8.5.7-5.el6.x86_64
tkinter-2.6.6-36.el6.x86_64
[root@li250-193 Python-2.7.4]
# rpm -qa | grep ^tcl
tcl-8.5.7-6.el6.x86_64
|
我系统中装的是8.5,所以这里我改成了8.5
保存退出
安装tck-devel、tk-devel
1
|
[root@li250-193 Python-2.7.4]
# yum -y install tcl-devel tk-devel
|
开始配置安装
1
2
3
4
5
6
7
|
[root@li250-193 Python-2.7.4]
# ldconfig
[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模块
1
2
3
4
5
6
|
[root@li250-193 Python-2.7.4]
# ./python
Python 2.7.4 (default, Apr 12 2013, 08:49:11)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type
"help"
,
"copyright"
,
"credits"
or
"license"
for
more
information.
>>>
import
Tkinter
>>>
|
已经没问题