突然想起 robot framework 终于支持 python3 了,想着不是特别忙,可以试一下装起来!万万没想到就踩进了一个深坑!以此记录下我犯的那些乱七八糟的错!✍
此篇纯粹碎碎念和吐槽,非技术分享~

首先找了下网上的教程一顿操作,但网上基本上都是 python3.7 或者 3.6 的环境,而本秃头女孩用的 3.8,此刻我就开始慌了......这个版本问题我真是慌得不行,差一丢丢就疯狂报错,事实证明,我的担心是对的🙄 因为版本不对安装不上,我陷入了换版本的困境........先贴一下现在的版本情况👇 太难了 55555😭
python3.8

安装过程就不多说了,反正就是很心酸,以下是安装步骤:
1、安装 python3.8
2、在线安装 robotframework:pip install robotframework
3、在线安装 Pypubsub:Pypubsub==3.3.0 (这玩意别装太高的版本,亲测会有问题😭 哭,至少目前我用这个版本没啥问题....)
4、在线安装 wxPython:wxPython==4.0.7 (这个版本不能太低......太低不支持 python3.8,太高也会报错....爆哭😭 ,然后就找了个版本不高,又支持 3.8 的,就是你了!)
5、在线安装 robotframework-ride:pip install robotframework-ride==1.7.4.1 (这个才是最崩溃的,我本来直接在线安装,然后就安装了最新版 1.7.4.2,结果死活装不上,一直报错,我还以为我网不好,结果仔细一看,不对,这个熟悉的报错,又是版本问题???哭辽,我又去看官方对应的版本,结果人家没说明....好吧,手动降一级试试,终于装上了!!!👏 莫急,装好了也还是会有问题的)
6、安装 appiumlibrary:pip install robotframework-appiumlibrary
7、安装 selenium2library:pip install robotframework-selenium2library
8、把对应版本的【chromedriver.exe】放到 python3 的目录下

安装终于结束了,我以为我能愉快的打开我熟悉的小格子界面,愉快的双击图标,没反应......然后试试 win+R+ride.py,直接找到我 python2.7 的路径下边去了????🙃 ,我还不放弃,找到 python 路径下的 scripts 下的 ride.py 执行 “python ride.py”,又报错了........👇

Traceback (most recent call last):
File “d:\program files (x86)\python\lib\site-packages\robotide\application\application.py”, line 58, in OnInit
self.frame = RideFrame(self, self._controller)
File “d:\program files (x86)\python\lib\site-packages\robotide\ui\mainframe.py”, line 175, in init
self._init_ui()
File “d:\program files (x86)\python\lib\site-packages\robotide\ui\mainframe.py”, line 279, in _init_ui
self.tree = Tree(self, self.actions,
File “d:\program files (x86)\python\lib\site-packages\robotide\ui\tree.py”, line 86, in init
self._images = TreeImageList()
File “d:\program files (x86)\python\lib\site-packages\robotide\ui\images.py”, line 42, in init
TestCaseController: _TreeImage(self, ‘robot.png’),
File “d:\program files (x86)\python\lib\site-packages\robotide\ui\images.py”, line 80, in init
self.normal = self._get_image(image_list, normal)
File “d:\program files (x86)\python\lib\site-packages\robotide\ui\images.py”, line 91, in _get_image
img = wx.Image(path, wx.BITMAP_TYPE_PNG).ConvertToBitmap()
wx._core.wxAssertionError: C++ assertion “strcmp(setlocale(LC_ALL, NULL), “C”) == 0” failed at …\src\common\intl.cpp(1579) in wxLocale::GetInfo(): You probably called setlocale() directly instead of using wxLocale and now there is a mismatch between C/C++ and Windows locale.
Things are going to break, please only change locale by creating wxLocale objects to avoid this!
OnInit returned false, exiting…
Error in atexit._run_exitfuncs:
wx._core.wxAssertionError: C++ assertion “GetEventHandler() == this” failed at …\src\common\wincmn.cpp(478) in wxWindowBase::~wxWindowBase(): any pushed event handlers must have been removed

好吧,又继续改,把修改 application.py 中 self._initial_locale = wx.Locale(wx.LANGUAGE_ENGLISH) 改为:

self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)

问题是我还报错...🙃

Traceback (most recent call last):
  File "D:\Applications\python3.8.0\lib\site-packages\robotide\__init__.py", line 82, in main
    _run(inpath, not noupdatecheck, debug_console)
  File "D:\Applications\python3.8.0\lib\site-packages\robotide\__init__.py", line 101, in _run
    from robotide.application import RIDE
  File "D:\Applications\python3.8.0\lib\site-packages\robotide\application\__init__.py", line 16, in <module>
    from .application import RIDE, Project
  File "D:\Applications\python3.8.0\lib\site-packages\robotide\application\application.py", line 50
    self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)
                                               ^
TabError: inconsistent use of tabs and spaces in indentation


Use --help to get usage information.

缩进问题???我就是担心空格缩进的问题,直接复制的源码进行的修改,实在是想不通,小脑瓜灵机一现,对比了下边的源码,呵呵呵我改的内容是两个 tab,源码是空格还是啥🙃 ,一定要注意前边和后边的空格和缩进啊啊啊啊啊啊!!!重新用源码的格式粘贴过去,就可以打开了!(简单粗暴的方式就是直接 copy 下边肯定没问题的代码的空格或者缩进)

真开心,终于解决了这个问题😭 而且我的桌面图标也可以双击打开了哈哈哈哈哈哈,图标真可爱,新的页面真好看哈哈哈哈哈哈!炫耀!

----------------------------------------我是无情的分割线----------------------------------
我发现的我 ride 虽然打开了,但是我的小格子没有了😩 还有好几个库没装....继续努力!!!

----------------------------------------补充内容---------------------------
1、ExcelLibrary 没有对应的可安装版本,在线安装时会报错

ERROR: Could not find a version that satisfies the requirement robotframework-excellibrar (from versions: none)
ERROR: No matching distribution found for robotframework-excellibrar

2、昨天遇到的 edit 页面空白,百度了一大圈,说 3.8 不兼容......简直无情.....python 版本回退到 3.7.5
附上当前版本


↙↙↙阅读原文可查看相关链接,并与作者交流