Install PyQt for Maya

Submitted by Benoit on Sat, 04/24/2010 - 17:35

If you read the pdf file Windows_QT_Installation.pdf located in C:\Program Files\Autodesk\Maya2009\devkit\other\PyQtScripts under windows, you may find yourself doing some useless manipulations. Indeed, new releases of PyQt integrates Qt directly. here is what I did:

  1. Install Python 2.5.4. This is mostly to test if everything is fine. I used this version instead of the last one because at the time of writing, it is the one that had windows installer;
  2. Install PyQt for Python 2.5. it will install necessary Qt files;
  3. Execute C:\Python25\Lib\site-packages\PyQt4\examples\demos\qtdemo\qtdemo.pyw. You should be able to browse the PyQt examples and demos.
  4. Copy content of C:\Python25\Lib\site-packages directory in C:\Program Files\Autodesk\Maya2009\Python\lib\site-packages directory.

And it should be ok!

Try executing the following script:

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
 
app = QApplication(sys.argv)
hello = QPushButton("Hello world!")
hello.show()

Best regards.
Benoît