Jan 07

Installing PyQt for maya 2011 (OSX)


I am now hosting a built package for Maya2011: MyQt4.7.4-maya2011-x64-osx-10.6.pkg
And for Maya 2012+, see: Installing pyqt4 for maya2012

Personally, when trying to run PyQt from within Maya 2009/2010 using the pumpThread method, I never had much luck. The best I ever got was the ability to bring up a dialog but not without locking up the UI, even though the pumpThread tool is meant to address that.

Anyways, when I found out Maya 2011 was rewritten based on Qt for the UI, I was really stoked. I saw the example video of being able to design a ui file in Designer, and just directly open it in a maya script, and all I could think about was designing Qt GUIs so much more easily now. Turns out that Maya 2011 didn’t actually ship with PyQt included for licensing reasons I’m sure. But it included documentation on how one could go about building PyQt for maya. Unfortunately I had tons of issues that caused maya to just crash when importing PyQt.

What I finally figured out was a mish-mash of information from the maya documention, and different forums and user groups. So I decided to make this easier on anyone having the same problems as I did, and just collect that information into one place. This process is for OSX. I’m sure most of it is probably still relevant to linux or win, except for the last parts with ‘install_name_tool’. You would just need to make sure to find the right Qt/PyQt/SIP packages for your OS.

Building PyQt4 for Maya 2011 on OSX

Update for Maya 2012

While Maya uses newer versions, it seems the versions from the 2011 install still work. But here they are anyways incase you want the newer version for 2012:

Make sure you have downloaded and installed the latest XCode from Apple. Its also included on your OSX installation disc.

Qt: Maya has a specific version of Qt built into it. This is Qt 4.5.3.
  1. Download:  qt-mac-opensource-src-4.5.3.tar.gz
  2. Extract:
  3. Build and install:
SIP: The maya docs recommend sip version 4.10
  1. Download this specific SIP:   sip-4.10.tar.gz
  2. Extract:
  3. Build and install:
PyQt4: The maya docs suggest PyQt 4.7
  1. Download this specific PyQt: PyQt-mac-gpl-4.7.4.tar.gz
  2. Extract:
  3. Set up some environment variables before building:
  4. Build and install:
  5. PyQt4 will now be installed into Maya’s python site-packages, BUT will be linked against the wrong Qt binaries. The maya docs have an annoying multi step set of commands but they don’t copy/paste nicely, so here is a for-loop you can use:

At this point you should be able to start up Maya and import and run PyQt from the script editor. You no longer need the pumpThread. Here is a test code snippet that I borrowed from here (the original had typos in it that I corrected)

It doesn’t seem like you even need the install of Qt 4.5.3 that we did at this point since we changed the links, unless you use another Qt module besides QtCore, QtGui, QtSvg, QtXml, QtOpenGL (such as QtNetwork), but this could be solved by copying over the missing libs to where Maya is expecting them. Example for copying over QtNetwork:

If you happen to have a mixed library environment like me, with more than one python lib location for code, and you see any funny errors while importing a module, just make sure that mayas python site-package is always in the front of the sys.path:

And there you have it. PyQt4 now installed in Maya 2011 under OSX.



1 ping

Skip to comment form

  1. Aditya

    I had been having some other problem with qt & maya 2011.
    your info about copying libQtNetwork from the troltech dir to maya/lib did the trick

  2. ArrantSquid

    I was just writing up some similar instructions because I couldn’t find any, only to stumble here and find this. So I’m glad the info is out there and I can stop. :) Just so you know, both your links are dead, however, if you go to http://distfiles.macports.org/python/ and search for both versions of PyQt and SIP you can get them from there. :) I had tried symlinking the installs from my site-packages to maya’s site-packages and using sys.path.append to add the folders from site-packages to Maya, but while it would “work” it would crash maya every time. I hate having dual installs of packages, but apparently Maya requires it. :/ Thanks again for the write up.

  3. Justin Israel

    @ArrantSquid: You are very welcome! And thanks for letting me know about the links. I just updated them.

  4. apostl3pol

    Great tute, thanks for posting this. It all worked well for me except that PyQt wouldn’t build. I finally figured out that copy-pasting the #4 “Build and Install” step into the terminal was giving me minuses and not dashes (or vice-versa), so it couldn’t find the paths. Typed those manually and everything went smoothly.

  5. Paul Jones


    when i run the command from part 3

    ./configure -cocoa -arch x86_64 -debug-and-release -no-phonon -no-phonon-backend -no-qt3support -no-webkit -nomake docs -nomake examples -nomake demos -nomake translations -no-rpath -no-framework
    I’m presented with these choices.

    Type ‘c’ if you want to use the Commercial Edition.
    Type ‘o’ if you want to use the Open Source Edition.

    i Choose ‘o’ and get the following message:

    You don’t seem to have ‘make’ or ‘gmake’ in your PATH.
    Cannot proceed.

    i Do have the latest Xcode installed too.

    can you help

    many thanks

  6. Izzy

    What Paul Jones said also happens to me :( Help?

  7. Nicolas

    I know this if off topic but I’m looking into starting my own blog and was curious what all is needed to get setup? I’m assuming having
    a blog like yours would cost a pretty penny? I’m not very internet smart so I’m not 100% certain.
    Any tips or advice would be greatly appreciated. Cheers

  1. AnimateShmanimate.com | Maya and PyQt on OSX Snow Leopard and Hating It

    […] a working install for Maya; and 3) I got most of my information to get a fully working version from Justin Israel’s site, so big ups to him for that. I’m going to assume you’re using the stock version of […]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">