PyQt Maya Implimentation Error

I have been trying to follow this tutorial Recently and I have come across this problem

What i put into Maya 2013 X64

from PyQt4 import uic
form_class, base_class = uic.loadUiType(‘path/to/uifile.ui’)

Resulting error is

Error: IOError: file C:\Program Files\Autodesk\Maya2013\bin\python26.zip\xml\etree\ElementTree.py line 579: 2

Anyone find a solution to this problem?

Just a guess, but it seems like bad XML in your UI file. Try loading the file directly with


from elementtree.ElementTree import parse

tree = parse(filename)
elem = tree.getroot()

and see if it causes the same problem

make sure the path is right, the IO error usually means i cant find the file on the uic stuff

hmm some more updates

from elementtree.ElementTree import parse

tree = parse(filename)
elem = tree.getroot()

results in # Error: ImportError: file <maya console> line 1: No module named elementtree.ElementTree #

Tried importing elementtree / ElementTree still same result

printed the listed paths

import sys
print(sys.path)

[‘C:\Program Files\Autodesk\Maya2013\bin’, ‘C:\Program Files\Autodesk\Maya2013\bin’, ‘C:\Program Files\Autodesk\Maya2013\mentalray\scripts\AETemplates’, ‘C:\Program Files\Autodesk\Maya2013\mentalray\scripts\mentalray’, ‘C:\Program Files\Autodesk\Maya2013\mentalray\scripts\unsupported’, ‘C:\Program Files\Autodesk\Maya2013\mentalray\scripts’, ‘C:\Program Files\Autodesk\Maya2013\bin\python26.zip’, ‘C:\Program Files\Autodesk\Maya2013\Python\DLLs’, ‘C:\Program Files\Autodesk\Maya2013\Python\lib’, ‘C:\Program Files\Autodesk\Maya2013\Python\lib\plat-win’, ‘C:\Program Files\Autodesk\Maya2013\Python\lib\lib-tk’, ‘C:\Program Files\Autodesk\Maya2013\Python’, ‘C:\Program Files\Autodesk\Maya2013\Python\lib\site-packages’, ‘C:\Program Files\Autodesk\Maya2013\bin\python26.zip\lib-tk’, u’C:/Users/Ken/Documents/maya/2013-x64/prefs/scripts’, u’C:/Users/Ken/Documents/maya/2013-x64/scripts’, u’C:/Users/Ken/Documents/maya/scripts’]

The files were found in my

C:\Program Files\Autodesk\Maya2013\Python\Lib\site-packages
(PyQt4 \ sip.pyd)

and my ElementTree in

“C:\Program Files\Autodesk\Maya2013\bin\python26.zip”

=( This seems like a tough nut to crack. Might be i’m missing files? or misplaceing them? I tried reinstalling both and i get the same problem X(

Ah found the problem. The files were saved in the wrong area DOH. Thanks for all the help though. Much apperciated

Doh, my bad - it’s from xml.etree.ElementTree import parse