Python Post-Job Script Errors

Hi,
I am having some issues with a post-job python script. We are using Deadline 4.0 and Python 3.1. The issue is that IronPython is having difficulty using standard Python libraries. We’d like to keep our current Python scripts/modules and not rewrite them for Deadline/IronPython/.net, if that can be avoided.

Initially, I got this error:
Error executing post job script: Python Error: No module named os (IronPython.Runtime.Exceptions.ImportException)

I tried adding “C:\Python31\Lib” to the IronPython search path in the repository options, but this didn’t have any effect.

I then tried this solution, which I found on the forums:
import sys
sys.path.append( “C:\Python31\Lib” )

This worked to a certain extent, being that I no longer get the error about finding the “os” module. However, now I get this error:
Error executing post job script: Python Syntax Error: unexpected token ‘o777’ (Microsoft.Scripting.SyntaxErrorException)
File: C:\Python31\Lib\os.py
Line: 122
Column: 26
(System.Exception)

Is this a compatibility issue with Python 3.1 specifically? Is there an older version of Python that’s safer to use?

Thanks,
Aaron

Hi Aaron,

Deadline uses IronPython 2.6, which is compatible with Python 2.6.

I should note that not all modules may work with IronPython, but I think the os and sys modules should be fine.

Cheers,

  • Ryan

Perhaps it would be useful to have a Deadline list of what modules are not supported by IronPython and hence Deadline scripting somewhere on this forum, to help people save time wondering why their code isn’t working?
Maybe a cross-reference from the IronPython docs?
For example, I discovered this week the “zipfile” module is supported but NOT the “zlib”…!

EDIT: I spoke too soon…
lists.ironpython.com/pipermail/u … 05851.html

Thanks for the link. I wrote this simply script to print out the modules:

import sys
def __main__(*args):
	print( sys.builtin_module_names )

Saved it as “get_modules.py” and then ran this command:

deadlinecommand.exe -ExecuteScript "get_modules.py"

Here are the results I got:

Cheers,

  • Ryan

I uploaded a script to help quickly lookup what python module is supported by IronPython, CPython, etc…
viewtopic.php?f=57&t=4327
MIke