Houdini and Python 2.7

   12302   8   1
User Avatar
Member
68 posts
Joined: 10月 2011
Offline
Hello, I had a working Houdini Apprentice installed until I launched it after installing Python 2.7(from python website). Houdini doesn't launch and the message below keeps printing in Houdini Console.

I have 0 idea on how to fix this. Should I install Python 3.3? Is there an order of installation I must do? Please help me.

File “C:\PYTHON27\LIB\abc.py”, line 109, in register
if issubclass(subclass, cls):
File “C:\PYTHON27\LIB\abc.py”, line 184, in __subclasscheck__
cls._abc_negative_cache.add(subclass)
File “C:\PYTHON27\LIB\_weakrefset.py”, line 84, in add
self.data.add(ref(item, self._remove))
TypeError: cannot create weak reference to ‘classobj’ object

Could not create the default HDA shelf tool for ‘cop2net’:
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “CPROGRA~1/SIDEEF~1/HOUDIN~1.683/houdini/python2.6libs\hou.py”, line 36122, in <module>
import os
File “C:\PYTHON27\LIB\os.py”, line 398, in <module>
import UserDict
File “C:\PYTHON27\LIB\UserDict.py”, line 84, in <module>
_abcoll.MutableMapping.register(IterableUserDict)
File “C:\PYTHON27\LIB\abc.py”, line 109, in register
if issubclass(subclass, cls):
File “C:\PYTHON27\LIB\abc.py”, line 184, in __subclasscheck__
cls._abc_negative_cache.add(subclass)
File “C:\PYTHON27\LIB\_weakrefset.py”, line 84, in add
self.data.add(ref(item, self._remove))
TypeError: cannot create weak reference to ‘classobj’ object

Could not create the default HDA shelf tool for ‘opengl’:
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “CPROGRA~1/SIDEEF~1/HOUDIN~1.683/houdini/python2.6libs\hou.py”, line 36122, in <module>
import os
File “C:\PYTHON27\LIB\os.py”, line 398, in <module>
import UserDict
File “C:\PYTHON27\LIB\UserDict.py”, line 84, in <module>
_abcoll.MutableMapping.register(IterableUserDict)
File “C:\PYTHON27\LIB\abc.py”, line 109, in register
if issubclass(subclass, cls):
File “C:\PYTHON27\LIB\abc.py”, line 184, in __subclasscheck__
cls._abc_negative_cache.add(subclass)
File “C:\PYTHON27\LIB\_weakrefset.py”, line 84, in add
self.data.add(ref(item, self._remove))
TypeError: cannot create weak reference to ‘classobj’ object

Could not create the default HDA shelf tool for ‘framedep’:
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “CPROGRA~1/SIDEEF~1/HOUDIN~1.683/houdini/python2.6libs\hou.py”, line 36122, in <module>
import os
File “C:\PYTHON27\LIB\os.py”, line 398, in <module>
import UserDict
File “C:\PYTHON27\LIB\UserDict.py”, line 84, in <module>
_abcoll.MutableMapping.register(IterableUserDict)
File “C:\PYTHON27\LIB\abc.py”, line 109, in register
if issubclass(subclass, cls):
File “C:\PYTHON27\LIB\abc.py”, line 184, in __subclasscheck__
cls._abc_negative_cache.add(subclass)
File “C:\PYTHON27\LIB\_weakrefset.py”, line 84, in add
self.data.add(ref(item, self._remove))
TypeError: cannot create weak reference to ‘classobj’ object

Could not create the default HDA shelf tool for ‘batch’:
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “CPROGRA~1/SIDEEF~1/HOUDIN~1.683/houdini/python2.6libs\hou.py”, line 36122, in <module>
import os
File “C:\PYTHON27\LIB\os.py”, line 398, in <module>
import UserDict
File “C:\PYTHON27\LIB\UserDict.py”, line 84, in <module>
_abcoll.MutableMapping.register(IterableUserDict)
File “C:\PYTHON27\LIB\abc.py”, line 109, in register
if issubclass(subclass, cls):
File “C:\PYTHON27\LIB\abc.py”, line 184, in __subclasscheck__
cls._abc_negative_cache.add(subclass)
File “C:\PYTHON27\LIB\_weakrefset.py”, line 84, in add
self.data.add(ref(item, self._remove))
TypeError: cannot create weak reference to ‘classobj’ object

Could not create the default HDA shelf tool for ‘dopnet’:
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “CPROGRA~1/SIDEEF~1/HOUDIN~1.683/houdini/python2.6libs\hou.py”, line 36122, in <module>
import os
File “C:\PYTHON27\LIB\os.py”, line 398, in <module>
import UserDict
File “C:\PYTHON27\LIB\UserDict.py”, line 84, in <module>
_abcoll.MutableMapping.register(IterableUserDict)
File “C:\PYTHON27\LIB\abc.py”, line 109, in register
if issubclass(subclass, cls):
File “C:\PYTHON27\LIB\abc.py”, line 184, in __subclasscheck__
cls._abc_negative_cache.add(subclass)
File “C:\PYTHON27\LIB\_weakrefset.py”, line 84, in add
self.data.add(ref(item, self._remove))
TypeError: cannot create weak reference to ‘classobj’ object

Could not create the default HDA shelf tool for ‘geometry’:
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “CPROGRA~1/SIDEEF~1/HOUDIN~1.683/houdini/python2.6libs\hou.py”, line 36122, in <module>
import os
File “C:\PYTHON27\LIB\os.py”, line 398, in <module>
import UserDict
File “C:\PYTHON27\LIB\UserDict.py”, line 84, in <module>
_abcoll.MutableMapping.register(IterableUserDict)
File “C:\PYTHON27\LIB\abc.py”, line 109, in register
if issubclass(subclass, cls):
File “C:\PYTHON27\LIB\abc.py”, line 184, in __subclasscheck__
cls._abc_negative_cache.add(subclass)
File “C:\PYTHON27\LIB\_weakrefset.py”, line 84, in add
self.data.add(ref(item, self._remove))
TypeError: cannot create weak reference to ‘classobj’ object
User Avatar
Member
7046 posts
Joined: 7月 2005
Offline
Try Python 2.6, that's what Houdini, Maya and Nuke all use…
Cheers,

Peter Bowmar
____________
Houdini 20.5.262 Win 10 Py 3.11
User Avatar
Member
181 posts
Joined: 2月 2013
Offline
Good idea. The Houdini system requirements still read as though Python 2.6.4 is the latest supported version.

Maybe Houdini can't find the new Python library and executable paths. Updating the environmental variables to point to the latest Python location might help in that case.

Nevertheless, on Windows, the application ought to default to the Python version packaged with Houdini, residing in the standard $HFS location.

http//www.sidefx.com/docs/houdini12.1/hom/
User Avatar
Member
68 posts
Joined: 10月 2011
Offline
Got it working when I replaced Python 2.7 with Python 2.6.4 as suggested.

Is there a way to keep different version of Python? I mean for Houdini to not use the Python version I install and use its own that comes with the package?

Thanks
User Avatar
Member
1922 posts
Joined: 11月 2006
Online
You can set HOUDINI_USE_HFS_PYTHON to 1 and that will tell Houdini to use the Python version in its install directory.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
4 posts
Joined: 7月 2013
Offline
Hey guys. I have spent the whole day trying to understand what's wrong with my PyQt4<->Houdini setup and why Houdini(12.5.456) doesn't see PyQt4 libraries.
Currently python-2.7.5 from brew is on my mac(Mountain Lion) and Houdini uses 2.6.7. PyQt works perfectly while I launch any script from terminal but Houdini doesn't see libraries.
>>> import PyQt4
Traceback (most recent call last):
File “<console>”, line 1, in <module>
ImportError: No module named PyQt4
Please advice what should I do to make PyQt visible to Houdini?

Thanks
User Avatar
Member
1922 posts
Joined: 11月 2006
Online
Since Houdini uses Python 2.6 you'll need to have Python 2.6 installed on your system as well as PyQt installed for 2.6. There is no way for Houdini to use Python 2.7 or the PyQt modules installed for it.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
5 posts
Joined: 7月 2013
Offline
Still no luck. I installed Python 2.6.8 + PyQt4. Surely it works in terminal, also it works if I add HOUDINI_PYTHON_BIN = /opt/local/bin/python to houdini.env. And python can load PyQt4 now. But there are a bunch of errors in Houdini appears with this changes:
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “/Library/Frameworks/Houdini.framework/Versions/12.5.456/Resources/houdini/python2.6libs/sas/localassets.py”, line 10, in <module>
import urllib2
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py”, line 94, in <module>
import httplib
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py”, line 78, in <module>
import mimetools
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/mimetools.py”, line 6, in <module>
import tempfile
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/tempfile.py”, line 34, in <module>
from random import Random as _Random
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/random.py”, line 47, in <module>
from os import urandom as _urandom
ImportError: cannot import name urandom

I found HOUDINI_PYTHON_LIB, HOUDINI_USE_HFS_PYTHON, HOUDINI_PYTHON_VERSION variables and tried them with different values, but that doesn't help.
Any suggestions?
User Avatar
Member
5 posts
Joined: 7月 2013
Offline
Actually if I set python lib to:
HOUDINI_PYTHON_LIB = /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python
similar to rvinluan's advice from this thread:
http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=28933&highlight=HOUDINI_PYTHON_BIN [sidefx.com]
and HOUDINI_PYTHON_VERSION to 2.6 then Houdini doesn't want to start at all
  • Quick Links