1 安装AutoItLibrary
最简单的安装方法是用pip安装,首先在pypi(https://pypi.org)上搜索autoitlibrary,可以找到一个叫robotframework-autoitlibrary的robot库。也可以在命令行用“pip search autoitlibrary”进行查找。在windows命令行运行命令安装:
pip install robotframework-autoitlibrary
2、报错的原因是因为没有whl文件,下载命令
pip install wheel
3、再使用
pip install robotframework-autoitlibrary
4、安装pip install Autoitlibrary命令报错
发现是没有下载wordcloud,要下载对应版本,但是这个的下载cp37不正确,我抱着试试的心态,下载wordcloud,然后再安装Autoitlibrary
pip install wordcloud
装好后再安装又有报错
然后到https://pypi.org/project/AutoItLibrary/1.1.post1/#modal-close
网站直接下载AutoItLibrary-1.1post1解压文件放到了C盘根目录下
此时直接使用python setup.py install会报错,原因是因为python3环境和python2环境的print写法不一致
setup.py文件里所有print打印的内容都需要用括号括起来(python2的语言print不需要括号,python3的需要),如下图
此时保存后再进入AutoItLibrary-1.1.post1文件夹下输入下面这句话
python setup.py install
还是有错误提示
Don't think we need to unregister the old one...
%SYSTEMROOT%\system32\regsvr32.exe /S F:\Python3\Lib\site-packages\AutoItLibrary\lib\AutoItX3.dll
python F:\Python3\Lib\site-packages\win32com\client\makepy.py F:\Python3\Lib\site-packages\AutoItLibrary\lib\AutoItX3.dll
Traceback (most recent call last):
File "F:\Python3\Lib\site-packages\win32com\client\makepy.py", line 69, in
import sys, os, pythoncom
File "F:\Python3\lib\site-packages\pythoncom.py", line 2, in
import pywintypes
File "F:\Python3\lib\site-packages\win32\lib\pywintypes.py", line 136, in
__import_pywin32_system_module__("pywintypes", globals())
File "F:\Python3\lib\site-packages\win32\lib\pywintypes.py", line 64, in __import_pywin32_system_module__
import _win32sysloader
ImportError: DLL load failed: 找不到指定的模块。
Traceback (most recent call last):
File "setup.py", line 81, in
subprocess.check_call(cmd)
File "F:\Python3\lib\subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'python F:\Python3\Lib\site-packages\win32com\client\makepy.py F:\Python3\Lib\site-packages\AutoItLibrary\lib\AutoItX3.dll' returned non-zero exit status 1.
发现一篇文章说还要安装AutoIt,不带Library的。否则AutoItLibrary还是红色的——64位电脑需要下载64位的
下载地址:https://www.autoitscript.com/site/autoit/downloads/
装完后,再次操作,还是报错。。。我要再研究一下
我的Win7的电脑,在失败无数次python setup.py install后,第二天再次进入C:\AutoItLibrary-1.1 post1路径后,再次使用python setup.py install,安装成功。
Win10手动把语法错误的信息用括号括进去后,安装成功
装完AutoIt后,重启ride.py,重新写入,不再变红,按F5,点击“Source”的下拉选项,看看是否有AutoItLibrary相关的关键字
PS:感谢以下博主提供的各类解决方法
1、https://blog.csdn.net/liuy36/article/details/86741929
2、https://blog.csdn.net/weixin_41592575/article/details/78984585
3、https://blog.csdn.net/m0_38015368/article/details/80182477
4、https://blog.csdn.net/Skywin88/article/details/100020255
5、https://blog.csdn.net/dahuier1991/article/details/87908780
6、https://www.cnblogs.com/laiyyy520/p/5779273.html
7、https://jingyan.baidu.com/article/54b6b9c08f4dc42d583b4784.html
8、https://www.cnblogs.com/tangsong41/p/10552260.html
9、https://blog.csdn.net/xiaoning800/article/details/79743080
10、https://blog.csdn.net/tangwendi/article/details/90707233——之后尝试用此方法的步骤安装
11、https://blog.csdn.net/wy2963/article/details/89359428