1. 安裝必要的套件
$ sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n libwxgtk2.8-dev libgtk2.0-dev
2. 下載source和patch
$ cd ~
$ wget "http://downloads.sourceforge.net/project/wxpython/wxPython/2.9.4.0/wxPython-src-2.9.4.0.tar.bz2"
$ wget "http://downloads.sourceforge.net/project/wxpython/wxPython/2.9.4.0/wxPython-src-2.9.4.1.patch"
$ tar xvjf wxPython-src-2.9.4.0.tar.bz2
$ patch -p 0 -d wxPython-src-2.9.4.0/ < wxPython-src-2.9.4.1.patch
$ mkdir wxPython-src-2.9.4.0/bld
3. 再安裝相依的套件
$ sudo apt-get install dpkg-dev build-essential swig python-dev libwebkit-dev libjpeg-dev libtiff-dev checkinstall freeglut3 freeglut3-dev libgtk2.0-dev libsdl1.2-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libgconf2-dev libglapi-mesa libosmesa6 libglu1-mesa-dev libglu1-mesa mesa-common-dev
4. 等非常非常久的編譯和安裝
$ cd wxPython-src-2.9.0.1/wxPython
$ python build-wxpython.py --build_dir=../bld --install
5. 確認版本
$ python -V
6. 複製需要的library
$ sudo cp /usr/local/lib/libwx_* /usr/lib
7. 測試
$ python demo/demo.py
reference: Building and installing wxPython 2.9.4.0 on Raspberry Pi (Raspbian)
沒有留言:
張貼留言