我正在尝试在docker镜像上启动我的机器人代码。所以我已经安装了python3和所有我需要的库(我希望如此)。以下是一个概述:
$ 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有什么建议吗?
编辑:这是DataDriver模块在docker镜像上的安装轨迹:
$ 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发布于 2019-10-09 19:48:47
尝试将我自己pc上的库版本与安装在镜像上的版本进行匹配时出错。我应该这么做的。删除我的pip安装中的版本规范修复了这个问题。
发布于 2019-10-09 17:10:23
您是否尝试过在导入库时更改编码参数?
*** Settings ***
Library DataDriver
... encoding=cp1252不知道哪一个是正确的,但是下面的链接有一个指向其他选项的链接。
该示例来自here。
https://stackoverflow.com/questions/58299837
复制相似问题