hi guys,
Today I want to post data to the URL in Event plugin, I use the urllib module of IronPython, I test the post data script in IronPython 2.6, it works well.
Then the script was put in OnJobFinished, I got a Error message when submitting Job " no modules urllib ".
I think Deadline script can access any IronPython module, maybe it cannt.
Is there another way to get/post data to URL in deadline?
When you start the standard IronPython interpreter, it loads up all the modules from the IRONPYTHONPATH env. var.
But, when you’re only using the PythonEngine in the IPy.dll (simply put), there are no env. variables being read by default.
So, if you’ve put anything special in the IRONPYTHONPATH env. var., which I believe you or the installer did (because, and correct me if I’m wrong, the urllib is actually a Python module, right?), you’ll have to manually extend the standard path to search for modules in your scripts.
I always do it this way (assuming you have setup the IRONPYTHONPATH env. var. on ALL the network machines)
loocas, thank you!
Your method is good, I got the script work.
Most problems about IronPython working with Deadline can be solved by your method.
I also make the script work using .net module System.Net.
I make a mistake, your method may work once or I typed the wrong file name.
Later I tested the script in cmd with deadlinecommand -executescript
The urllib module still cannt be loaded.
The script example I gave you assumes you have the environment variable set globally. If you use user-specific env. vars. then it’s a bit different story.
Just make sure you have the env. var. set properly and it will work every time all the time. There’s no black magic about this method.
Try opening the IPy.exe shell and type in the code I wrote. If it prints out the correct contents of the IRONPYTHONPATH, then it should always work as well. If not, then there will be an issue somewhere. Maybe a typo or something minor.
There is no IRONPYTHONPATH env variable in my OS.
First I used global env var Path, the script didnt work.
Then the absolute path of IronPython lib was appended to sys.path.
Setting a global env var for each render node is a hard work, I prefer adding absolute path in script.