执行名为 ride.py 的文件时,收到以下错误消息:
不支持使用ansi编码的wxPython您需要安装 wxPython 2.8工具包,支持unicode运行RIDE。看到 http://wxpython.org了解更多信息。
配置:
看起来骑行不支持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 :(得分:1)
看起来你已经安装了wxPython的ANSI版本,并从Installation Instructions安装了robotframework-ride(他们的重点):
RIDE的GUI使用wxPython工具包实现。版本2.8.6或 较新的 Unicode支持是必需的。 ANSI版本不是 支撑。
因此,在使用Unicode支持构建之后,您需要重新安装wxPython。根据{{3}},您的配置应包含--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 \
答案 1 :(得分:0)
将--enable-unicode添加到configure命令。
答案 2 :(得分:0)
使用linux(至少RHEL和centos)时需要注意的另一点是python版本。根据我的经验,乘坐不适用于python 2.7。你必须使用python 2.6。