AWS Thinkbox Discussion Forums

"no module named os"

Hi,

we’d like to use pre/post job python scripts with standard python libs, like “os”, “sys” etc. One benefit is to be able to test the scripts locally before using them on deadline jobs. I know ironpython has only the built-in methods though.

So following the mentioned instructions in this tread, I installed a regular python 2.6 on the slave. Then I tried both to set the IRONPYTHONPATH variable to the lib folder of python 2.6 and to copy the modules to the local C:\Programme\Frantic Films\Deadline\bin folder on the slave.

I cant’t get the os module loaded. Has somebody experienced and solved this?

cheers
Marcus

When you set the IRONPYTHONPATH environment variable, did you restart all the Deadline applications (including the Launcher) so that they recognized the change? When you run a Deadline application from the Start Menu, it is run through the Launcher app. So everything needs to be restarted before the change is recognized.

Cheers,

  • Ryan

Sorry - Still no success so far. Are there maybe other env variables than “IRONPYTHONPATH” that deadline/ironpython recognizes?

Yeah, just tested that here and that doesn’t seem to work. However, the following does seem to work:

import sys

sys.path.append( "C:\\Python25\\Lib" )
import os

def __main__():
    print os.name

So it looks like IronPython implements the sys library. We use it to append the python Lib path to the list of paths that python search path (sys.path), and then we import the os library.

Cheers,

  • Ryan

In 3.1, we’re adding an option in the Repository options to specify a semicolon separated list of paths to append to the search path. For example, you could specify this:

c:\Python25\Lib;/usr/lib/python2.5

These paths will automatically be added to the iron python engine before executing the script, so you don’t have to add them manually in each script. Because you can separate multiple paths with semicolons, it doesn’t matter if the python lib files are in a different location on different machines.

Cheers,

  • Ryan

Thanks Ryan!

The “sys.path.append( “C:\Python25\Lib” )”-approach worked out for us. We now use a mix of native python and Deadline.Scripting modules.

You can even give it a path pointing to a network accessible place, containing (in our case) only the Python24 lib folder. The v2.6.1 had some bugs - the 2.4 worked well. That way the slaves don’t need to have Python installed at all. Plus you can easily add own py modules to that place.

Marcus

Privacy | Site terms | Cookie preferences