获得源码:
源码从 http://www.wxpython.org 获得
安装相应开发库:
sudo apt-get install libgtk2.0-dev
sudo apt-get install libgstreamer0.10-dev
sudo apt-get install libgstreamer-plugins-base0.10-dev
编译并安装:
cd wxPython-src-2.9.0.1/wxPython
sudo python2.6 build-wxpython.py --build_dir=../bld 只编译不安装
sudo python2.6 build-wxpython.py --build_dir=../bld --install 编译并安装
报错处理:
src/helpers.cpp:32:36: 致命错误: wx/gtk/private/win_gtk.h:没有那个文件或目录
在邮件列表里有说明,需要安装一个补丁来解决,链接如下:
打补丁方法:
wangzhaohe@wzh:~/下载/wxPython-src-2.9.4.0$ patch -p0 <../wxPython-src-2.9.4.1.patch
导入报错:
import wx
ImportError: libwx_gtk2u_adv-2.9.so.4: cannot open shared object file: No such file or directory
解决方法:
You need to tell the system to look for shared libs in that path.
You can do that by setting LD_LIBRARY_PATH or you can edit
/etc/ld.so.conf and then run ldconfig to update the system search
paths.
运行下面的命令:
sudo ldconfig