AutoSys Workload Automation

 View Only
  • 1.  Error while running Python script through Autosys.

    Posted Jul 01, 2019 11:26 PM
    Python2.7 script in Linux server is running without any issues when executed through command prompt. However the same is not working when it run through Autosys R11.3.6. This python is importing pandas module and while running through autosys its throwing error ImportError: No module named pandas.


  • 2.  RE: Error while running Python script through Autosys.

    Broadcom Employee
    Posted Jul 02, 2019 01:32 AM
    Hi,

    Normally for this type of problem, the root cause comes down to the environment being different when running a job and when executing on a command line.
    Since it is a python script, perhaps the PYTHONPATH is not being set.  There are a couple of agentparm settings that have to do with sourcing the environment and also the initial working directory.  The job's profile, may need to be added or updated. 
    A link to the agentparm settings is: https://docops.ca.com/ca-workload-automation-system-agent/11-4/en/reference/ca-wa-agent-for-unix-linux-windows-or-iseries-agent-parameters#CAWAAgentforUNIX,Linux,Windows,oriSeriesAgentParameters-oscomponent.environment.variable

    As a first step, you may want to run a job with the same owner/machine and just run a env or set command to see what is set.

    Regards,
    Mike


  • 3.  RE: Error while running Python script through Autosys.
    Best Answer

    Posted Jul 07, 2019 09:57 PM
    Hi Mike,
    Thanks for your response. I've defined the PYTHONPATH, but still the job didn't import the pandas module. After discussing with Server admin, I've added the LD_LIBRARY_PATH variable in the autosys profile. This resolved the issue. 

    Thank you. 

    Regards,
    Palanisamy Raja.


  • 4.  RE: Error while running Python script through Autosys.

    Posted Jul 02, 2019 08:48 AM
    Please verify script if you are using all module name with full path within script.

    ------------------------------
    Coca-cola
    ------------------------------