Rundeck - 我为运行 python 脚本而创建的作业调用了不同的 python [英] Rundeck - The job that I created to run python scripts calls a different python

查看:25
本文介绍了Rundeck - 我为运行 python 脚本而创建的作业调用了不同的 python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用 Rundeck.我有应该执行 python 文件的工作.只是给你一个概述我的设备有 python 3.8.5 和 3.7.Rundeck 使用 3.7 版,即使在我的环境变量中我将 PY_HOME 设置为 3.8.5 版.如何告诉我的 rundeck 使用 3.8.5 版?感谢您的帮助.

I'm quite new in using Rundeck. I have job that should be executing a python file. Just to give you an overview my device has python 3.8.5 and 3.7. Rundeck uses the version 3.7 even though in my environment variable I set my PY_HOME for version 3.8.5. How can I tell my rundeck to use version 3.8.5? Appreciate the help.

推荐答案

您可以在脚本步骤中为您的脚本(python2、python3 等)定义任何解释器,只需转到您的工作,在脚本"上步骤(内联脚本)或脚本文件或 URL"一步点击高级"按钮并在调用字符串"上添加 Python 3.8.5 的路径;文本框和.py"关于扩展"文本框,看看这个.

You can define any interpreter for your scripts (python2, python3, etc) on your scrip steps, just go to your job, on the "Script" step (inline script) or "Script File or URL" step click on the "Advanced" button and add the path of your Python 3.8.5 on "Invocation String" textbox and the ".py" on "Extension" textbox, take a look at this.

我留下了一个工作定义示例:

I leave a job definition example with this:

<joblist>
  <job>
    <defaultTab>nodes</defaultTab>
    <description></description>
    <executionEnabled>true</executionEnabled>
    <id>031b03b4-220f-4ad0-9c47-3ca47506ba82</id>
    <loglevel>INFO</loglevel>
    <name>HelloWorldPy</name>
    <nodeFilterEditable>false</nodeFilterEditable>
    <plugins />
    <scheduleEnabled>true</scheduleEnabled>
    <sequence keepgoing='false' strategy='node-first'>
      <command>
        <fileExtension>.py</fileExtension>
        <script><![CDATA[print("hello world!")]]></script>
        <scriptargs />
        <scriptinterpreter>C:\Users\user\AppData\Local\Programs\Python\Python38\python.exe</scriptinterpreter>
      </command>
    </sequence>
    <uuid>031b03b4-220f-4ad0-9c47-3ca47506ba82</uuid>
  </job>
</joblist>

这篇关于Rundeck - 我为运行 python 脚本而创建的作业调用了不同的 python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆