2013-05-13 56 views
0

当执行一个名为ride.py文件,我得到了以下错误消息:运行ride.py显示错误“的wxPython使用ANSI编码,不支持”

wxPython中使用ANSI编码,不支持你需要安装 带有unicode支持的wxPython 2.8工具包来运行RIDE。有关更多信息,请参阅 http://wxpython.org

配置:

  • 我的操作系统是CentOS6
  • Python版本是2.7
  • wxWidget版本是2.8.12
  • 乘坐版本robotframework骑-1.1
  • robotframework版本是2.7.7

它看起来骑车不支持ansi模式。 但xw.platformINfo包含如下的“ansi”。

>>> print wx.PlatformInfo 
('__WXGTK__', 'wxGTK', 'ansi', 'gtk2', 'wx-assertions-off', 'SWIG-1.3.29') 

但是作为源代码的wxPython是在OS上编译的。所以我不知道如何设置“ansi”模式。 编译步骤说明如下:

$../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 \ 
      --with-libjpeg=builtin \ 
      --with-libpng=builtin \ 
      --with-libtiff=builtin \ 
      --with-zlib=builtin ; 
    $vi .make 
     (content of .make file) 
     make $* \ 
      && make -C contrib/src/gizmos $* \ 
      && make -C contrib/src/stc $* 
    $.make 
    $.make install 

    $cd wxPython 
    $python setup.py build_ext --inplace --debug WX_CONFIG=/opt/wx/2.8/bin/wx-config BUILD_GLCANVAS=0 
    $python setup.py install WX_CONFIG=/opt/wx/2.8/bin/wx-config 

感谢您的意见。


我可以更改wx.PlatformInfo的价值?????

回答

0

将--enable-unicode添加到configure命令。

+0

感谢您的帮助。但它不起作用。 – user2378427 2013-05-14 07:09:01

1

看起来你已经安装的wxPython的ANSI版本,并从Installation Instructions为robotframework骑(妆点):

RIDE的GUI实现使用wxPython的工具包。版本2.8.6或 更新与需要Unicode支持。 ANSI版本不支持 。

所以你需要重新安装wxPython之后,它已经建立了Unicode支持。由于每build guide,你的配置应该包括--enable-unicode和看起来像这样:

../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 \ 
0

还有一点,而在Linux上使用骑注意(ATLEAST RHEL和CentOS)是Python版本。在我的经验骑会不会使用python 2.7。你将不得不使用python 2.6。