robotframwork安装excellibrary总结

python3.9.6版本使用pip install robotframework-excellibrary,会报错:

 

 

 1.此时需根据报错的版本路径进行离线下载,zip包下载完成后解压至对应的python路径包D:\python\Lib\site-packages:

robotframework-ExcelLibrary离线下载链接如上截图里路径地址:
http://mirrors.aliyun.com/pypi/packages/b8/e7/8c079a814e7ad288ec2fc15671d8dc526e3d537bb00e4ab2b209a63674ed/robotframework-excellibrary-0.0.2.zip
 
2.由于python3.x函数调用的区别,需针对如下文件的部分语句进行调整,具体修改如下:
  1) setup.py(文件路径:D:\python\Lib\site-packages\robotframework-excellibrary-0.0.2下)

 #execfile(join(dirname(file), ‘ExcelLibrary’, ‘version.py’))

exec(open(join(dirname(__file__), 'ExcelLibrary', 'version.py')).read())

 

2)ExcelLibrary.py(文件路径:D:\python\Lib\site-packages\robotframework-excellibrary-0.0.2\ExcelLibrary下)
#from version import VERSION
from .version import VERSION
另外:需将所有的print xxx 语句修改为 print(xxx)
 
3) init.py(文件路径:D:\python\Lib\site-packages\robotframework-excellibrary-0.0.2\ExcelLibrary下)

 #from ExcelLibrary import ExcelLibrary

#from version import VERSION

 from .ExcelLibrary import ExcelLibrary

from .version import VERSION
 
3.cmd模式进入D:\python\Lib\site-packages\robotframework-excellibrary-0.0.2路径,使用 python setup.py install进行手动安装,安装完成后使用pip list结果

 

4.重新开启ride,导入ExcelLibrary,导入标红显示有部分模块缺少,根据提示安装相应模块即可

1)在Tools—View RIDE Log查看问题显示:Importing library 'ExcelLibrary' failed: ModuleNotFoundError: No module named 'natsort'

使用pip install natsort,进行natsort模块的下载和安装;

2)在Tools—View RIDE Log查看问题显示:Importing library 'ExcelLibrary' failed: ModuleNotFoundError: No module named 'xlrd'

使用pip install xlrd,进行xlrd模块的下载和安装;

3)在Tools—View RIDE Log查看问题显示:Importing library 'ExcelLibrary' failed: ModuleNotFoundError: No module named 'xlwt'

使用pip install xlwt,进行xlwt模块的下载和安装;

4)在Tools—View RIDE Log查看问题显示:Importing library 'ExcelLibrary' failed: ModuleNotFoundError: No module named 'xlutils'

使用pip install xlutils,进行xlutils模块的下载和安装;

 

5、重新开启ride,导入ExcelLibrary成功

 

 

 

 

 

posted @ 2022-03-11 16:13  奔跑的番茄汁  阅读(948)  评论(0编辑  收藏  举报