首页 > 解决方案 > DataDriver 库方法 _stats_suite 失败:TypeError: 'encoding' is an invalid keyword argument for this function

问题描述

我正在尝试在 docker 映像上启动我的机器人代码。所以我已经安装了 python 3 和我需要的所有库(我希望)。这是一个概述:

$ pip list
Package                        Version
------------------------------ -------
asn1crypto                     0.24.0 
bcrypt                         3.1.7  
cffi                           1.12.3 
configparser                   3.5.0b2
cryptography                   2.7    
cx-Oracle                      7.2.3  
entrypoints                    0.3    
enum34                         1.1.6  
ipaddress                      1.0.17 
keyring                        17.1.1 
keyrings.alt                   3.1.1  
mercurial                      4.8.2  
paramiko                       2.6.0  
pip                            18.1   
pycparser                      2.19   
pycrypto                       2.6.1  
PyGObject                      3.30.4 
PyNaCl                         1.3.0  
pyxdg                          0.25   
robotframework                 3.1.2  
robotframework-databaselibrary 1.2.4  
robotframework-datadriver      0.0.3  
robotframework-sshlibrary      3.3.0  
scp                            0.13.2 
SecretStorage                  2.3.1  
setuptools                     3.4    
six                            1.12.0 
wheel                          0.32.3 

但是当我尝试启动机器人代码时,它在代码中的第一个调用是针对 DataDriver 库的,但它似乎失败了。据我所知,该错误意味着它没有正确安装,但它在上面提到的列表中。我收到的错误:

$ robot --outputdir output IPS/BCMC.robot
==============================================================================
BCMC                                                                          
==============================================================================
[ ERROR ] Calling method '_start_suite' of listener 'DataDriver' failed: TypeError: 'encoding' is an invalid keyword argument for this function
Dummy test Case                                                       | FAIL |
Test case contains no keywords.
------------------------------------------------------------------------------
BCMC                                                                  | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output:  /builds/tcc--test-automation/back-office-bcmc/int2peach-bcmc/output/output.xml
Log:     /builds/tcc--test-automation/back-office-bcmc/int2peach-bcmc/output/log.html
Report:  /builds/tcc--test-automation/back-office-bcmc/int2peach-bcmc/output/report.html
ERROR: Job failed: exit code 1

有什么建议么?

编辑:这是 docker 映像上 DataDriver 模块安装的跟踪:

$ pip install robotframework-datadriver==0.0.3
Collecting robotframework-datadriver==0.0.3
  Downloading https://files.pythonhosted.org/packages/5d/d2/d980c9fecca7bc595c1c86a9f8eaf67cc4c740b41317431c43cef2125c80/robotframework-datadriver-0.0.3.tar.gz (64kB)
Building wheels for collected packages: robotframework-datadriver
  Running setup.py bdist_wheel for robotframework-datadriver: started
  Running setup.py bdist_wheel for robotframework-datadriver: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/01/47/fe/ecf3f26ea74c3fd7a1089b0eb6ec41d232f36e17b315b3d7da
Successfully built robotframework-datadriver
Installing collected packages: robotframework-datadriver
Successfully installed robotframework-datadriver-0.0.3

标签: python-3.xdockerrobotframework

解决方案


尝试将我自己电脑上的库版本与图像上安装的版本匹配时出错。应该做的。在我的 pip 安装中删除版本规范解决了这些问题。


推荐阅读