Linux-wxpython3.0安装

转载 http://blog.sina.com.cn/s/blog_c22e36090102waa1.html

#下载wxPython 3.0.2.0版本
#解压安装包:
[root@pydev sf_linux_share]# tar -jxvf wxPython-src-3.0.2.0.tar.bz2
#编译安装包:
[root@pydev wxPython-src-3.0.2.0]#./configure --prefix=/usr/local/lib/wxpython3.0
[root@pydev wxPython-src-3.0.2.0]# make
[root@pydev wxPython-src-3.0.2.0]# make install
#进入wxPython安装目录:
[root@pydev wxPython-src-3.0.2.0]# cd wxPython
#编译wxPython:
[root@pydev wxPython]# python setup.py build_ext --inplace --debug WX_CONFIG=/usr/local/lib/wxpython3.0/bin/wx-config BUILD_GLCANVAS=0
#设置环境变量加入到~/.bash_profile
export LD_LIBRARY_PATH=/usr/local/lib/wxpython3.0/lib:$LD_LIBRARY_PATH  
export PYTHONPATH=/usr/local/wxPython
#如果是在图形界面中,你可以选择logout再login的方式使系统reload文件.bash_profile,当然最方便是使用source。
[root@pydev wxPython-src-3.0.2.0]# source ~/.bash_profile
#进入安装目录,将wxPython编译好的目录复制到/usr/local:
[root@pydev wxPython]cd /media/sf_linux_share/wxPython-src-3.0.2.0/
[root@pydev wxPython-src-3.0.2.0]# cp -rf wxPython /usr/local/
#测试wx包是否可用,没提示出错表示成功:
[root@pydev Desktop]# python
Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx

你可能感兴趣的:(Linux)