The guy sitting next to me kept getting this Python error at startup (which meant I had to either fix his install or continue taking all the CrowdFX cases 😉
' ERROR : 2000 - Failed creating scripting engine: XSI.SIPython.1. ' pythoncom error: PythonCOM Server - The 'win32com.server.policy' module could not be loaded. ' <type 'exceptions.ImportError'>: No module named win32com.server.policy ' pythoncom error: CPyFactory::CreateInstance failed to create instance. (80004005)
This happened only with the Python installed with Softimage. We did runonce.bat. We checked that Python was in the PATH. I scoured a Process Monitor log for several hours. But no luck. After a few days off, I came back and took another look at his Process Monitor log, and I noticed that at a certain point, Softimage switched over to reading files from the system Python install (in C:\Python26). And that was the clue.
It turns out that the environment variable PYTHONHOME was set to C:\Python26. Unsetting that environment variable was the solution.
Setting PYTHONPATH to C:\Python26 also causes the same error.
this happens on my machine really annoying now as Ive just done a clean install of 2013SP1 still does it. there is no PYTHONPATH or any path to python in environment variables.. no workgroups, clean install
# ERROR : 2000 – Failed creating scripting engine: XSI.SIPython.1.
# pythoncom error: PythonCOM Server – The ‘win32com.server.policy’ module could not be loaded.
# : No module named win32com.server.policy
# pythoncom error: CPyFactory::CreateInstance failed to create instance. (80004005)
# ERROR : 2000 – Failed creating scripting engine: XSI.SIPython.1.
# pythoncom error: PythonCOM Server – The ‘win32com.server.policy’ module could not be loaded.
# : No module named win32com.server.policy
# pythoncom error: CPyFactory::CreateInstance failed to create instance. (80004005)
I think something is still pointing to the system Python.
Open a Softimage cmd prompt and run “set”. That will show the environment. Then, if it was up to me, I’d do a Process Monitor log to make sure there’s nothing obvious going wrong.
What happens in you uninstall the system Python?
just uninstalled all versions of python – the system one and 26, reinstalled 2013SP1 and get similar error
‘ ERROR : 2000 – Failed creating scripting engine: XSI.SIPython.1.
‘ pythoncom error: PythonCOM Server – The ‘win32com.server.policy’ module could not be loaded.
‘ : No module named win32com.server.policy
‘ pythoncom error: CPyFactory::CreateInstance failed to create instance. (80004005)
looks like the install is not installing python or win32? you want to see the output from that SET command in the SI cmd prompt?
oh I found a python path in there its
PYTHONHOME=c:\program files <x86)\ncar\VAPOR\lib\python2.6
what the heck is vapor?
The Softimage Python is here:
C:\Program Files\Autodesk\Softimage 2013 SP1\Application\python
Did you unset that PYTHONHOME environment variable before you started 2013?
ah, just checked, its exactly the same pathhome for 2012 SAP and that works fine with no errors. its something wrong with 2013 install
and further checking I have some weather visualisation app called vapor installed! just uninstalling that to see what happens. looks like user error *blush* but why does 2012 still work though and uses this vapor path?
and.. uninstalling Vapor fixed 2013. & SP1 but still it never broke 2012 and inspecting 2012’s cmd prompt with ‘set’ again, well now there is no PYTHONHOME.. 2013 getting a bit sensitive to other apps are we? anyways its fixed now, thanks XSIsupport!
Things change, it could be something in the Softimage code, or something to do with the new VC++ version maybe? All it would take is some difference in the order of search paths when looking for files on the file system.
Another possible fix would be to set PYTHONHOME in setenv.bat:
set PYTHONHOME=%XSI_BINDIR%\Application\Python;%PYTHONPATH%
ah yes – in another case you said that Pythonhome=c:\python26 was causing the similar error. that one ^ above ^ would have fixed it as what I was looking for but could not find!