码迷,mamicode.com
首页 > 其他好文 > 详细

AutoItLibrary安装和常见问题解决

时间:2018-07-12 00:28:57      阅读:3568      评论:0      收藏:0      [点我收藏+]

标签:pytho   import   turned   cts   执行命令   需要   目录   releases   表示   

AutoItLibrary 安装步骤:

 

1、 安装pythonwin32

 

在下载地址:http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/找到对应自己python的pythonwin32版本,下载并安装pythonwin32。

最新的版本为build220。

技术分享图片

注意】:不管电脑的版本是否为32或者64位的,pythonwin32的版本需要匹配python的版本。

Python的版本可以按照以下步骤查看:cmd->python

技术分享图片

2、  安装AutoItLibrary

 

2.1下载

 

https://github.com/qitaos/robotframework-autoitlibrary/releases/tag/robotframework-AutoItLibrary-1.1.1

 

 

2.2安装

 

将上面下载好的AutoItLibrary解压,然后以管理员身份【很重要!很重要!很重要!】打开cmd窗口,使得当前目录为AutoItLibrary的存放目录,然后通过cmd命令python setup.py install进行安装。一般安装正常的话,cmd窗口会输出下图所示的信息,就表示安装成功了。

技术分享图片

 

验证是否成功安装

*  若已经成功安装了,则在C盘可以看到多了一个文件夹:RobotFramework,里面存放的就是RobotFramework的扩展库。

技术分享图片

** 进入python shell环境,通过输入import AutoItLibrary,若没有报错则表示AutoItLibrary 成功安装。

技术分享图片

*** 通过进入robotframework界面,通过导入AutoItLibrary库,看是否显示正常(黑色显示)。

技术分享图片

****或者通过关键字搜索,看看是否可以显示AutoItLibrary库。

技术分享图片

3、 安装AutoIt V3

 

由于AutoIt V3不支持64为机器,需要安装AutoIt V3。

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

 

4、常见错误处理

4.1 在安装过程中出现错误:

subprocess.CalledProcessError:Command‘%SYSTEMROOT%\system32\regsvr32.exe*\Lib\AutoItX3.dll’returned non-zero exit status 5 

技术分享图片

【解决方法】:

利用管理员身份运行cmd,然后cd到AutoItLibrary的目录下,再执行命令:python setup.py install。

如果仍然无法解决问题,可以找到setup.py 内subprocess.check_all(cmd,shell=True)和subprocess.CalledProcessError(retcode,cmd),并将其注释掉。再重新以管理员身份运行python setup.py install命令。

 

4.2 安装好了AutoItLibrary,但是导入到RIDE后,仍然红色显示,并在cmd窗口内输出如下错误信息:

Initializing test library ‘AutoItLibrary’with no arguments failed:com_error(-2147024703, ‘OLE error 0x800700c1‘, None,None)

或者提示错误信息:

Creating an instance of the test library‘AutoItLibrary‘ with no arguments failed: com_error: (-2147221164,‘\xc3\xbb\xd3\xd0\xd7\xa2\xb2\xe1\xc0\xe0‘, None, None)

技术分享图片

 

【解决方法】:

重新以管理员身份运行cmd,并切换到AutoItLibrary目录下安装。Cmd命令窗口输出以下信息:

技术分享图片

再依据前文第2点,重新检查一遍是否已经正确安装。

AutoItLibrary安装和常见问题解决

标签:pytho   import   turned   cts   执行命令   需要   目录   releases   表示   

原文地址:https://www.cnblogs.com/xiaohuhu/p/9297390.html

(0)
(1)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!