wxpython 编译

要在这个上面弄点东东了.于是今天装了一下。还是有一些问题的,所以记录一下吧。
具体的安装,可以参见http://www.wxpython.org/builddoc.php,记录的是最详细的
但是也许刚看的时候,可能没有耐心认真仔细的阅读,导致安装出错,中文解释一下:

1。安装wxWiget包:

      解压后在其目录下建立bld文件夹,然后运行configure:

   mkdir bld
cd bld
../ configure --prefix =/ opt / wx / 2.8
              --with-gtk

              --with-gnomeprint

              --with-opengl

              --enable-
debug
              --enable-geometry

              --enable-graphics_ctx

              --enable-sound --with-sdl

              --enable-mediactrl

              --enable-display

              --disable-debugreport

              --enable-unicode

              --with-libjpeg
= builtin
              --with-libpng
= builtin
              --with-libtiff
= builtin
              --with-zlib
= builtin

2。编译安装:

制作一个脚本,命名为.make,放到bld目录下,内容如下:

make $ *
make - C contrib / src / gizmos $ *
make - C contrib / src / stc $ *

然后运行:

chmod u+x .make

.make

.make install

3。安装wxPython:

解压,然后在它的wxPython目录里运行:

python2.5 setup.py build_ext --inplace --debug WX_CONFIG=/opt/wx/2.8/bin/wx-config BUILD_GLCANVAS=0

BUILD_GLCANVAS=0,这个很关键哦,开始出现一大堆编译错误都是因为它。后来看见文档中,

If you get errors about being unable to find libGLU, wxGLCanvas being undeclared, or something similar then you can add BUILD_GLCANVAS=0 to the setup.py command line to disable the building of the glcanvas module.豁然开朗

WX_CONFIG=/ opt / wx / 2.8 / bin / wx-config 中的路径为configure时设置的路径

4。设置环境变量:

export LD_LIBRARY_PATH =/ opt / wx / 2.8 / lib
export PYTHONPATH
=/ home/jingle / wxPython - 2.8 . 3.0 / wxPython

当然,用export的方法,只能在当前终端有效啦,所以,我们还是最好修改.bash_profile文件,这样,无论在哪个终端,都好使啦。

测试一下,运行wxPython目录下的demo:

python demo.py

OK,搞定啦!!!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值