Facing issues while using XML data import with Keyshot 6.3.23 version

Started by vjirgale, April 19, 2017, 08:13:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vjirgale

Hello,

I am using XML parsing to read some project specific data to use it in Keyshot.
I had installed Python 3.4.3 version on my machine.
When I try to run following script, I get error in ElementTree.Parse() function.

Follwoing is my Keyshot script,


from xml.etree import ElementTree as ET
tree = ET.parse('C:\Temp\Rendering\RenderConfig.xml')
root = tree.getroot()
importTag = root.find("ImportFile")
fileName = importTag.get("FileName")
lux.openFile(fileName)
# Get component and their material data from file and apply
root = lux.getSceneTree()
for node in root.find(name = ""):
   node.setMaterial("Matte White")


I get following error,


Traceback (most recent call last):
  File "C:\Python34\lib\xml\etree\ElementTree.py", line 1462, in __init__
    import pyexpat as expat
ImportError: DLL load failed: The specified procedure could not be found.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "<string>", line 6, in <module>
  File "C:\Python34\lib\xml\etree\ElementTree.py", line 1187, in parse
    tree.parse(source, parser)
  File "C:\Python34\lib\xml\etree\ElementTree.py", line 592, in parse
    parser = XMLParser()
  File "C:\Python34\lib\xml\etree\ElementTree.py", line 1465, in __init__
    "No module named expat; use SimpleXMLTreeBuilder instead"
ImportError: No module named expat; use SimpleXMLTreeBuilder instead



Can someone please help in finding out the solution to above problem ?
When I comment the Keyshot specific code and run the File parsing in Python editor, the parsing works properly.

Thank you !

Regards,

Vinay