您好,冒昧请教一下Linux红帽子5.3安装wxpython的问题

yangjuan 发布于 2012/07/20 09:27
阅读 1K+
收藏 1

@周翼翼 你好,想跟你请教个问题:

我是个linux初学者,更是python的初学者。请教一下安装wxpython的问题

我下载的是:wxPython-src-2.8.11.0.tar.bz2

我的操作步骤如下:

1)把包拷贝到/opt下,然后解压

2)进入目录: cd /wxPython-src-2.8.10.1/wxPython

3)执行:python2.5 setup.py build_ext --inplace --debug WX_CONFIG=/opt/wx/2.8/bin/wx-config BUILD_GLCANVAS=0

然后就出错了,处错误信息如下:

src/gtk/_core_wrap.cpp:4033: 错误:‘wxNotificationOptions’ 未声明

src/gtk/_core_wrap.cpp: In function ‘PyObject* _wrap_ShowEvent_IsShown(PyObject*, PyObject*)’:
src/gtk/_core_wrap.cpp:28693: 错误:‘const class wxShowEvent’ 没有名为 ‘IsShown’ 的成员
src/gtk/_core_wrap.cpp: In function ‘PyObject* _wrap_PyApp_MacRequestUserAttention(PyObject*, PyObject*, PyObject*)’:
src/gtk/_core_wrap.cpp:32446: 错误:‘wxNotificationOptions’ 在此作用域中尚未声明
src/gtk/_core_wrap.cpp:32446: 错误:expected `;' before ‘arg2’
src/gtk/_core_wrap.cpp:32467: 错误:‘arg2’ 在此作用域中尚未声明
src/gtk/_core_wrap.cpp:32467: 错误:expected type-specifier before ‘wxNotificationOptions’
src/gtk/_core_wrap.cpp:32467: 错误:expected `>' before ‘wxNotificationOptions’
src/gtk/_core_wrap.cpp:32467: 错误:expected `(' before ‘wxNotificationOptions’
src/gtk/_core_wrap.cpp:32467: 错误:expected `)' before ‘;’ token
src/gtk/_core_wrap.cpp: In function ‘PyObject* _wrap_new_EventLoopGuarantor(PyObject*, PyObject*)’:
src/gtk/_core_wrap.cpp:33387: 错误:‘wxEventLoopGuarantor’ 在此作用域中尚未声明
src/gtk/_core_wrap.cpp:33387: 错误:‘result’ 在此作用域中尚未声明
src/gtk/_core_wrap.cpp:33392: 错误:expected primary-expression before ‘)’ token
src/gtk/_core_wrap.cpp:33392: 错误:expected `;' before ‘new’
src/gtk/_core_wrap.cpp: In function ‘PyObject* _wrap_delete_EventLoopGuarantor(PyObject*, PyObject*)’:
src/gtk/_core_wrap.cpp:33405: 错误:‘wxEventLoopGuarantor’ 在此作用域中尚未声明
src/gtk/_core_wrap.cpp:33405: 错误:‘arg1’ 在此作用域中尚未声明
src/gtk/_core_wrap.cpp:33405: 错误:expected primary-expression before ‘)’ token
src/gtk/_core_wrap.cpp:33405: 错误:expected `;' before numeric constant
src/gtk/_core_wrap.cpp:33416: 错误:expected type-specifier before ‘wxEventLoopGuarantor’
src/gtk/_core_wrap.cpp:33416: 错误:expected `>' before ‘wxEventLoopGuarantor’
src/gtk/_core_wrap.cpp:33416: 错误:expected `(' before ‘wxEventLoopGuarantor’
src/gtk/_core_wrap.cpp:33416: 错误:expected primary-expression before ‘>’ token
src/gtk/_core_wrap.cpp:33416: 错误:expected `)' before ‘;’ token
src/gtk/_core_wrap.cpp:33419: 错误:‘delete’ 的参数类型应为指针而非 ‘<type error>’
src/gtk/_core_wrap.cpp: In function ‘PyObject* _wrap_GetAccelFromString(PyObject*, PyObject*, PyObject*)’:
src/gtk/_core_wrap.cpp:33954: 警告:‘wxGetAccelFromString’ 已过时(于 /opt/wx/2.8/include/wx-2.8/wx/utils.h:571 声明)
src/gtk/_core_wrap.cpp:33954: 警告:‘wxGetAccelFromString’ 已过时(于 /opt/wx/2.8/include/wx-2.8/wx/utils.h:571 声明)
src/gtk/_core_wrap.cpp: In function ‘PyObject* _wrap_Window_ClientToWindowSize(PyObject*, PyObject*, PyObject*)’:
src/gtk/_core_wrap.cpp:36197: 错误:‘const class wxWindow’ 没有名为 ‘ClientToWindowSize’ 的成员
src/gtk/_core_wrap.cpp: In function ‘PyObject* _wrap_Window_WindowToClientSize(PyObject*, PyObject*, PyObject*)’:
src/gtk/_core_wrap.cpp:36234: 错误:‘const class wxWindow’ 没有名为 ‘WindowToClientSize’ 的成员
src/gtk/_core_wrap.cpp: In function ‘PyObject* _wrap_Window_DragAcceptFiles(PyObject*, PyObject*, PyObject*)’:
src/gtk/_core_wrap.cpp:42490: 错误:‘class wxWindow’ 没有名为 ‘DragAcceptFiles’ 的成员
src/gtk/_core_wrap.cpp: In function ‘PyObject* _wrap_SizerFlags_ReserveSpaceEvenIfHidden(PyObject*, PyObject*)’:
src/gtk/_core_wrap.cpp:51397: 错误:‘class wxSizerFlags’ 没有名为 ‘ReserveSpaceEvenIfHidden’ 的成员
src/gtk/_core_wrap.cpp: In function ‘PyObject* _wrap_Sizer_ComputeFittingClientSize(PyObject*, PyObject*, PyObject*)’:
src/gtk/_core_wrap.cpp:54560: 错误:‘class wxSizer’ 没有名为 ‘ComputeFittingClientSize’ 的成员
src/gtk/_core_wrap.cpp: In function ‘PyObject* _wrap_Sizer_ComputeFittingWindowSize(PyObject*, PyObject*, PyObject*)’:
src/gtk/_core_wrap.cpp:54599: 错误:‘class wxSizer’ 没有名为 ‘ComputeFittingWindowSize’ 的成员
src/gtk/_core_wrap.cpp: In function ‘void init_core_()’:
src/gtk/_core_wrap.cpp:64139: 错误:‘wxRESERVE_SPACE_EVEN_IF_HIDDEN’ 在此作用域中尚未声明
src/gtk/_core_wrap.cpp:64486: 错误:‘wxNOTIFY_NONE’ 在此作用域中尚未声明
src/gtk/_core_wrap.cpp:64487: 错误:‘wxNOTIFY_ONCE’ 在此作用域中尚未声明
src/gtk/_core_wrap.cpp:64488: 错误:‘wxNOTIFY_REPEAT’ 在此作用域中尚未声明
error: command 'gcc' failed with exit status 1

加载中
0
情天大圣
情天大圣
1. 安装wxWidget包
  (1)解包: tar -zxvf wxWidget.tar.gz
  (2)进入解包后的wxWidget目录 建立bld文件夹:
  cd wxWidget
  mkdir bld
  cd bld
  (3)在bld目录下执行configure
  ../configure --prefix=/opt/wx/2.8 \
  --with-gtk \
  --with-gnomeprint \
  --with-opengl \
  --enable-debug \
  --enable-debug_gdb \
  --enable-geometry \
  --enable-graphics_ctx \
  --enable-sound --with-sdl \
  --enable-mediactrl \
  --enable-display \
  --enable-unicode \
  --with-libjpeg=builtin \
  --with-libpng=builtin \
  --with-libtiff=builtin \
  --with-zlib=builtin \
  (4)在bld目录下创建make脚本
  touch .make
  .make文件写入以下内容:
  make $* 
  make -C contrib/src/gizmos $* 
  make -C contrib/src/stc $*
  (5)编译脚本
  chmod u+x .make
  ./.make
  ./.make install
2. 安装wxPython
  (1)解包: tar -jxvf wxPython-src-2.8.10.1.tar.bz2
  (2)进入目录:cd /wxPython-src-2.8.10.1/wxPython
  (3)运行:python2.5 setup.py build_ext --inplace --debug WX_CONFIG=/opt/wx/2.8/bin/wx-config BUILD_GLCANVAS=0
3. 设置环境变量:export LD_LIBRARY_PATH=/opt/wx/2.8/lib
  export PYTHONPATH=/root/wxPython-src-2.8.10.1/wxPython
0
周翼翼
周翼翼
我没编译过这个,真不会.建议参考楼上的,或者直接用你的发行版的包管理工具直接装.
0
Daniel.Yee
Daniel.Yee

楼主是想在linux下做图形应用么?

其实也可以考虑下QT的,呵呵

0
yangjuan
yangjuan

情天大怪:之前我就是按您说的这种手顺进行安装的,没用,有相同的error

真是想哭,折腾了好几天了。

 

lincanye
lincanye
那么请问您后来是怎么解决的呢???我也遇到了相同的问题呢!!可以的话我们可以qq交流一下!2860959290
返回顶部
顶部