AWS Thinkbox Discussion Forums

Python Search Paths not available in Python jobs

Is there any way to add those Paths to the executed Python/IronPython scripts when submitting Python jobs to Deadline? It’d be great if they were mapped already and we didn’t have to add those paths manually in each Python script we submit to the farm.

Thanks!

Hi,
Under monitor, super user, repository options, “Python search paths”, you can add something like:

C:\Python25\Lib C:\Python26\Lib

So that all you need to do in any script is “import re” to import a module.

You wouldn’t want to automatically import ALL modules into a script as this would be wasteful and time consuming.
Is this what you mean or am I getting confused?! :slight_smile:

Oh and if you want to quickly remind yourself (ie: I use it all the time at work!) which modules are available natively in IronPython vs. CPython, then I wrote this quick script, available here:

viewtopic.php?f=57&t=4327

Cheers,
Mike

Thanks a lot for the script, Mike,

however, I’m reporting here since I do indeed have those paths set properly in the repository opts. but when I try to import a os module, for example, in my IPy script, I get an error. I have to manually add to the Path and then import the module in each script.

I experienced this in the PreLoad.py, but I’ll be testing the Python submission scripts later tonight as well.

sounds like the system hasn’t got the path to python.exe set in its path?

Have you set the system “environment variable” - “path” to have something like this?:

c:\python26;c:\python26\scripts

(Obviously, do this for each version of Python you want to use.)

Then you shouldn’t have to add the path each time.

HTH,
Mike

Thanks, but I want to deliberately avoid doing so. :slight_smile:

I mainly want to source these paths since these are the only paths that are guaranteed to be correct and centralized. The render farm can be a mess (or when you want to set variables to something else on all the machines etc…).

I wonder if having the ability to modify the environment from within Deadline would be useful.

You could create a PreLoad.py script for Deadline’s python plugin that sets the environment variable.

Cheers,

  • Ryan

THAT is actually pretty clever! Thank you. :slight_smile:

Privacy | Site terms | Cookie preferences