如何通过源码文件编译安装wxpython

part 1:首先安装wxGTK

1.解压wxGTK文件:

$ tar -xvzf wxGTK-2.2.5.tar.gz

2.进入目录:

$ cd wxGTK-2.2.5

3.运行configure脚本:

$ ./configure --with-gtk

如果没有安装GTK或GTK的头文件在这里就会出错:(参考:gtk+-devel-1.2.8-6mdk.i586.rpm  http://www.wxwidgets.org/)

4.运行make文件:

$ make

如果没有安装lex或者yacc这里会报错(参考: the right rpms are byacc-1.9-7mdk.i586.rpm and flex-2.5.4a-13mdk.i586.rpm)

5.这时的安装需要超级用户模式:

$ su
# make install 

6.链接函数库:

# ldconfig

7.退出超级用户:

# exit

8.进入目录并与安装文件建立符号链接:

$ cd /usr/lib
$ ln -s /usr/local/lib/libwx_gtk.so

wxGTK安装完毕

part 2:

1.解压文件:

$ tar -xvzf wxPython-2.2.5.tar.gz

2.进入目录:

$ cd wxPython-2.2.5

3.编辑setup.py文件,选择需要安装的选项,在选择的时候这里建议不要安装OGL和GL_CANVAS:

BUILD_GLCANVAS = 0 # If true, build the contrib/glcanvas extension module
BUILD_OGL = 0      # If true, build the contrib/ogl extension module
BUILD_STC = 1      # If true, build the contrib/stc extension module
CORE_ONLY = 0      # if true, don't build any of the above
GL_ONLY = 0        # Only used when making the -gl RPM.  See the "b" script
                   # for the ugly details
USE_SWIG = 0       # Should we actually execute SWIG, or just use the
                   # files already in the distribution?
IN_CVS_TREE = 0    # Set to true if building in a full wxWidgets CVS
                   # tree, otherwise will assume all needed files are
                   # available in the wxPython source distribution

4.建立python模块:

$ python setup.py build

5.进入超级用户安装该模块:

$ su
# python setup.py install

6退出超级用户,检查模块是否安装成功:

# exit
$ python
Python 1.5.2 (#1, Sep 30 2000, 18:08:36)  [GCC 2.95.3 19991030 (prerelease)] on linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import wx
>>>


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值