编程语言
首页 > 编程语言> > python3.8下安装robotframework历险记

python3.8下安装robotframework历险记

作者:互联网

       首先非常感谢本文章博主,极大的给与我可以装好的信心(差点要重装python)https://blog.csdn.net/qq_21583077/article/details/107848409?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-107848409-blog-108182535.pc_relevant_aa&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-107848409-blog-108182535.pc_relevant_aa&utm_relevant_index=1

      如上文章一样,他遇到的错误我都遇到了,但我比他还曲折

2、在线安装robotframework:pip install robotframework
3、在线安装 Pypubsub:Pypubsub==3.3.0 (这玩意别装太高的版本,亲测会有问题 哭,至少目前我用这个版本没啥问题....)
4、在线安装 wxPython:wxPython==4.0.7 (这个版本不能太低......太低不支持python3.8,太高也会报错....爆哭 ,然后就找了个版本不高,又支持3.8的,就是你了!)

补充:本人很早就装了3.5后面装了3.8.10,以为安装robotframework很顺利,但事与愿违,一开始ride闪退,我怀疑自己装了两个版本的python导致,但是后面将所有安装到3.8下还是一样有问题,不过有控制太报错,这也是迈向成功的第一步,至少知道自己哪里错了,有迹可循;同时我还百度查了3.8适合安装哪个wxpython版本,查的是4.1.1  。。。。,嗯,结果是个坑,还是不断提示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

所以在按照楼主的方法修改了一遍后还是老老实实执行pip install wxPython==4.0.7  进行降级,才可以,另外;修改文件,最好放到pycharm下进行编辑,真的在editplus上看不出来缩进问题,一直报错:TabError: inconsistent use of tabs and spaces in indentation
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”,又报错了........

  1.   Traceback (most recent call last):
  2.   File “d:\program files (x86)\python\lib\site-packages\robotide\application\application.py”, line 58, in OnInit
  3.   self.frame = RideFrame(self, self._controller)
  4.   File “d:\program files (x86)\python\lib\site-packages\robotide\ui\mainframe.py”, line 175, in init
  5.   self._init_ui()
  6.   File “d:\program files (x86)\python\lib\site-packages\robotide\ui\mainframe.py”, line 279, in _init_ui
  7.   self.tree = Tree(self, self.actions,
  8.   File “d:\program files (x86)\python\lib\site-packages\robotide\ui\tree.py”, line 86, in init
  9.   self._images = TreeImageList()
  10.   File “d:\program files (x86)\python\lib\site-packages\robotide\ui\images.py”, line 42, in init
  11.   TestCaseController: _TreeImage(self, ‘robot.png’),
  12.   File “d:\program files (x86)\python\lib\site-packages\robotide\ui\images.py”, line 80, in init
  13.   self.normal = self._get_image(image_list, normal)
  14.   File “d:\program files (x86)\python\lib\site-packages\robotide\ui\images.py”, line 91, in _get_image
  15.   img = wx.Image(path, wx.BITMAP_TYPE_PNG).ConvertToBitmap()
  16.   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.
  17.   Things are going to break, please only change locale by creating wxLocale objects to avoid this!
  18.   OnInit returned false, exiting…
  19.   Error in atexit._run_exitfuncs:
  20.   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)

问题是我还报错...

  1.   Traceback (most recent call last):
  2.   File "D:\Applications\python3.8.0\lib\site-packages\robotide\__init__.py", line 82, in main
  3.   _run(inpath, not noupdatecheck, debug_console)
  4.   File "D:\Applications\python3.8.0\lib\site-packages\robotide\__init__.py", line 101, in _run
  5.   from robotide.application import RIDE
  6.   File "D:\Applications\python3.8.0\lib\site-packages\robotide\application\__init__.py", line 16, in <module>
  7.   from .application import RIDE, Project
  8.   File "D:\Applications\python3.8.0\lib\site-packages\robotide\application\application.py", line 50
  9.   self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)
  10.   ^
  11.   TabError: inconsistent use of tabs and spaces in indentation
  12.    
  13.    
  14.   Use --help to get usage information.

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

 

标签:历险记,lib,robotide,self,py,robotframework,python,File,python3.8
来源: https://www.cnblogs.com/xixirang/p/16399413.html