Jenkins Python执行groovy.lang.MissingPropertyException:无此类属性:类的init

时间:2019-02-28 12:05:02

标签: python shell jenkins jenkins-pipeline jenkins-plugins

我正在尝试从Jenkins管道运行Python脚本,但出现以下异常,

sh "python3.6 eks-tf-generate.py --cluster-count ..."

groovy.lang.MissingPropertyException: No such property: init for class: groovy.lang.Binding
    at groovy.lang.Binding.getVariable(Binding.java:63)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:264)
    at org.kohsuke.groovy.sandbox.impl.Checker$6.call(Checker.java:288)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:292)

我还尝试安装Pyenv Pipeline插件,并将python执行保留在其中,

withPythonEnv('/usr/bin/python3.6')

仍然出现相同的异常。

我能够执行

sh "python3.6 --version"

没有任何错误。

詹金斯版2.150.3

0 个答案:

没有答案