【发布时间】:2018-02-20 07:57:36
【问题描述】:
代码: sh 'python ./selenium/xy_python/run_tests.py'
错误: 回溯(最近一次通话最后): 文件“./selenium/xy_python/run_tests.py”,第 6 行,在 进口鼻子 ImportError:没有名为nose的模块
【问题讨论】:
标签: python python-3.x dsl
代码: sh 'python ./selenium/xy_python/run_tests.py'
错误: 回溯(最近一次通话最后): 文件“./selenium/xy_python/run_tests.py”,第 6 行,在 进口鼻子 ImportError:没有名为nose的模块
【问题讨论】:
标签: python python-3.x dsl
我建议您在 jenkinsfile 中运行脚本之前显式激活 python 环境,以确保您处于安装了 nose 的环境中。
请查看 virtualenv、tox 或 conda 以获取有关如何执行此操作的信息。
【讨论】:
如果手动启动它是否运行成功?如果是,那么您可能在使用 PYTHONPATH 时遇到问题。你可以使用 withEnv 来设置它。
withEnv(['PYTHONPATH=/your/pythonpath']) {
sh 'python ./selenium/xy_python/run_tests.py'
}
【讨论】: