Workload Automation

Expand all | Collapse all

A programmer is wanting to submit a Python script using a cross platform job. He is getting errors because it is running as a shell script. Any suggestions?

Jump to Best Answer
  • 1.  A programmer is wanting to submit a Python script using a cross platform job. He is getting errors because it is running as a shell script. Any suggestions?

    Posted 10-06-2017 04:41 PM

    IM Renderer Page  

    Output of messages for workload object JQVAPB1U.N02436/GRS2SIT1.S00001D1727915+
    22/MAIN
    Start date Fri Oct  6 20:22:18 2017
    ----------------------------------------------------------------
    /u/applic/replen/global/scripts/qe_python.py: line 1: import: command not foun+
    d
    /u/applic/replen/global/scripts/qe_python.py: line 2: import: command not foun+
    d
    /u/applic/replen/global/scripts/qe_python.py: line 3: import: command not foun+
    d
    /u/applic/replen/global/scripts/qe_python.py: line 4: import: command not foun+
    d
    /u/applic/replen/global/scripts/qe_python.py: line 5: import: command not foun+
    d
    I tried executing it and it is being executed as shell script
    and these are the errors for it


  • 2.  Re: A programmer is wanting to submit a Python script using a cross platform job. He is getting errors because it is running as a shell script. Any suggestions?
    Best Answer

    Posted 10-06-2017 09:20 PM

    Use a shebang to let the UNIX shell know what interpreter to use.

    The top line of the python script should read:

     

    #!/usr/bin/python

     

    Or

     

    #!/usr/bin/env python

     

     

    This assumes that your script will run with the default python.

     

    Thanks & Regards,

    Chandru

    CA Technologies



  • 3.  Re: A programmer is wanting to submit a Python script using a cross platform job. He is getting errors because it is running as a shell script. Any suggestions?

    Posted 10-09-2017 09:09 PM

    Hi Ruben,

    Please let us know if the response helped/answered your query.

     

    Thank you,

    Chandru