Search - User list
Full Version: Tractor and Python 3
Root » PDG/TOPs » Tractor and Python 3
davidoberst
I haven't tried it, but I see you are producing Tech Preview builds of 18.0 that use Python 3. As best I can tell, Pixar's tractor.api modules are not Python-3-friendly even with the 2.4 release. I assume that the TOP tractor-scheduler node which uses those to create the tractor job doesn't work in these builds? You haven't done anything magical like provide modified versions of Pixar's modules…

We're also taking a very early look a writing a Tractor job from Blender (which is Python 3), so Pixar's lack of Python 3-compatible authoring modules is a bit of a pain.
chrisgreb
Nope, sorry we haven't started looking into getting Tractor working with our python 3 build yet. It's on our radar and I assume Pixar will start getting pressure to support the 2020 VFX platform standard.
davidoberst
What's the status of Tractor and Houdini 19/Python 3? While Pixar hasn't done a full Python 3 Tractor release yet, they do have their "tractor" Python API package converted, in Renderman 24. We don't have RMan24, but they also provided a beta of the package in their forum, and we've been using that successfully with Nuke 13, for instance, and put it on PYTHONPATH for our Houdini 19 setups. We can do PDG/TOP submissions from Windows to our (linux) Tractor farm, but when the main PDG cooking task runs on the farm, it throws the error below, in pdgmq.py.

It looks like TractorSpooler.spool_tractor_task() has a "drain()" subfunction which creates a NamedTemporaryFile and tries to write the TCL text of a tractor job to it. In Python3, the temp files get opened "w+b" by default, and the write() method wants "bytes", while the TCL job text is a "str". The temp file should probably be opened with in explicit "w" mode so it will accept the TCL "str"?

Does a basic spooling problem like this mean Tractor is not currently supported by Houdini 19?

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/opt/houdini/hfs19.0/python/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/opt/houdini/hfs19.0/houdini/python3.7libs/hou.py", line 99522, in __threadRun
    self.__run()
  File "/opt/houdini/hfs19.0/python/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/houdini/hfs19.0/houdini/python3.7libs/pdgjob/pdgmq.py", line 211, in drain
    tempf.write(self._tractortaskqueue.popleft())
  File "/opt/houdini/hfs19.0/python/lib/python3.7/tempfile.py", line 481, in func_wrapper
    return func(*args, **kwargs)
TypeError: a bytes-like object is required, not 'str'
daweisun
python3 requires Bytes instead of str when you write into tempfile, there will be a fix for this in Houdini 19.0.491. I can submit PDG job to tractor at our end with the fix.
davidoberst
Actually, you can write "str" to the tempfile if you open it with mode='w' or 'w+a', but converting the Tractor TCL 'str' text to bytes for the write() call would be good enough in this case. With the fix, the 'cook' task on the farm successfully spawns all the dynamic frame tasks to Tractor and the job succeeds? That would be great - I was reluctantly going to look into monkey-patching around this bug. It looks like 19.0.491 is there as a daily now - any rough idea when the next production build will be put together from 19.0.491 or higher?
rvinluan
davidoberst
It looks like 19.0.491 is there as a daily now - any rough idea when the next production build will be put together from 19.0.491 or higher?

Hello,

Production builds are updated roughly every 1-2 months so a new one should be updated in the next couple of weeks.

Cheers,
Rob
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB