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
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).