RIDE导入AutoItLibrary的安装以及遇到的问题

一、下载pywin32并安装,要对应自己的系统位数和python版本,比如我是64位,python3.7的版本下的pywin32-221.win-amd64-py3.7.exe

https://sourceforge.net/projects/pywin32/files/pywin32/Build%20221/

这里先去删除pywin32(pip uninstall删除不了,就去你的Python37\Lib\site-packages把它的文件全部手动删除),因为我没有删除之前的直接安装,打开cmd命令,pip list看pywin32版本号仍然是初始下载的228这里会导致ride引入AutoItLibrary爆红,但是python命令import AutoItLibrary又无异常

二、安装AutoIt V3 

自己是64位也不要更改一下选项容易出现兼容问题,注册失败就可以用以下四3的方法。

下载地址:https://www.autoitscript.com/site/autoit/downloads

三、安装AutoItLibrary

下载:https://www.softpedia.com/get/Programming/Components-Libraries/AutoItLibrary.shtml

解压后,以管理员身份切到你的解压目录AutoItLibrary-1.1下(这里有setup.py这个文件),然后python setup.py install。

这里可能会报错,需要你根据提示去修改AutoItLibrary-1.1指定的文件

我改好的https://download.csdn.net/download/u012739150/12598913,里面包含上面三步的安装包

四、验证安装是否成功,cmd命令切到python,然后输入import AutoItLibrary不报错。然后进入ride引入AutoItLibrary,如果爆红,就可能是上面任何一步没有安装好。

这里总结下ride引入AutoItLibrary爆红,但是python命令import AutoItLibrary又无异常时出现时的几种解决尝试:

1、如一那里安装pywin32没有安装生效,重新安装

2、利用cmd进入AutoItX3.dll文件所在路径,运行系统注销和系统注册命令:切到你的目录,好比我

cd D:\Python37\Lib\site-packages\AutoItLibrary\lib

regsvr32 /u AutoItX3.dll

regsvr32 /s AutoItX3.dll

3、cmd尝试ride.py会有以下错误时(此时ride已引入此库,系统以及python等软件都是64位引起的。)
FAILED AutoItLibrary Initializing test library 'AutoItLibrary' with no arguments failed: com_error: (-2147221164, '没有 注册类', None, None)

以管理员权限运行cmd(你的AutoIt3当时的路径,如果未更改就是以下)

cd C:\Program Files (x86)\AutoIt3\AutoItX\
regsvr32 AutoItX3_x64.dll

总结安装失败就是三者总有一种出现问题,需要自己确保都安装无误。

 

 

 

<div><p>I update the ride to the new version 1.7.3.1 but then AutoItLibrary turned to red and get this error:</p> <p>: Importing test library "C:\Python27\Scripts\E-SYS<em>TEST</em>AUTOMATION\03<em>E-SYS\12</em>Oberflächentests../../../../Lib/site-packages/AutoItLibrary/" failed</p> <p>Traceback (most recent call last): Initializing test library 'AutoItLibrary' with no arguments failed: com<em>error: (-2147221008, 'CoInitialize wurde nicht aufgerufen.', None, None) Traceback (most recent call last): File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 167, in _get</em>instance return libcode(<em>self.positional_args, *</em>dict(self.named<em>args)) File "C:\Python27\Lib\site-packages\AutoItLibrary_</em>init<strong>.py", line 84, in <em>_init</em></strong> self.AutoIt = win32com.client.Dispatch("AutoItX3.Control") File "C:\Python27\lib\site-packages\win32com\client_<em>init</em><em>.py", line 95, in Dispatch dispatch, userName = dynamic.</em>GetGoodDispatchAndUserName(dispatch,userName,clsctx) File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 114, in <em>GetGoodDispatchAndUserName return (</em>GetGoodDispatch(IDispatch, clsctx), userName) File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 91, in <em>GetGoodDispatch IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID</em>IDispatch) File "C:\Python27\lib\site-packages\robotide\spec\librarymanager.py", line 87, in <em>fetch</em>keywords return get<em>import</em>result(path, library<em>args) File "C:\Python27\lib\site-packages\robotide\spec\libraryfetcher.py", line 24, in get</em>import<em>result lib = robotapi.TestLibrary(path, args) File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 54, in TestLibrary lib.create</em>handlers() File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 100, in create<em>handlers self.</em>create<em>handlers(self.get</em>instance()) File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 159, in get<em>instance self.</em>libinst = self.<em>get</em>instance(self.<em>libcode) File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 169, in _get</em>instance self.<em>raise</em>creating<em>instance</em>failed() File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 314, in <em>raise</em>creating<em>instance</em>failed % (self.name, args_text, msg, details))</p> <p>with the RIDE version 1.5.2.1 work fine <img src="https://img-blog.csdnimg.cn/img_convert/346f7ce9340093856257374d97446131.png" alt="ERROR" /></p> </div>
©️2020 CSDN 皮肤主题: 书香水墨 设计师:CSDN官方博客 返回首页