0
votes

I'm trying to use PyQt4 inside MotionBuilder(Autodesk) (because i know qt really well and i don't like motionbuilder GUI api).

  • I'm on Windows 64 bits
  • I'm using MotionBuilder 2013 (64 bits)
  • I installed PyQt4 (64 bits) for Python 2.7
  • Updated my Path variable to point to PyQt4 dlls location (C:\Python27\Lib\site-packages\PyQt4)
  • When printing sys.path i can see the location of PyQt4
  • I can do import PyQt4 without errors

But when i try to do

from PyQt4 import QtGui

i get the following error

ImportError: DLL load failed: %1 is not a valid Win32 application.

I tried installing PyQt 32 bits binaries but got the same result. And i have QtGui4.dll and QtGui.pyd in my installation root folder. So i'm out of ideas, can anyone help me ?

There is someone else who got almost the same issue here PyQt4 import QtCore, QtGui ImportError: DLL load failed: %1 is not a valid Win32 application

3
Read this to see if it helps. stackoverflow.com/questions/19019720/…idjaw

3 Answers

1
votes

MotionBuilder 2013 supports Qt 4.7 and python 2.6.4 (source). Unfortunately, all the binaries on the PyQt website are for Qt 4.8+ and python 2.7 and 3.x. The PySide project still has some old binaries available for download, it's possible one of them may work for you (this one maybe).

You can also scour the web and you might be able to find a binary matching those versions -- here's an example (I just found this with a google search, I can't vouch for the legitimacy of the website or the download).

You could always compile Qt and pyQt/PySide yourself. I believe you'll need to use Visual Studio 2010.

1
votes

MotionBuilder 2013 only support Python 2.6 and PyQt4 is built with Python 2.7 at least =P

0
votes

Update to Motionbuilder 2014 or higher, which uses Pyton 2.7. Motionbuilder 2013 is one of the worst versions Autodesk came out with.

You will also need to put the pyqt site packages into your local Motionbuilder Python distribution:

C:\Program Files\Autodesk\MotionBuilder 2016\bin\x64\python\site-packages

as well as sip.pyd (which you can get here: http://nathanhorne.com/compiled-versions-of-pyqt4-x64/ mentioned in the previous answer).