1

I'm on the verge of giving up on trying to use PyQT4 in Maya 2016, already asked about it here.

But, in a lot of places I've looked, I keep picking up the notion that I should be using PySide instead. And I would love to - but now I'm pretty much stuck trying to convert Qt Designer's .ui output via PySide uic.

I did took a look at this question - I even tried follow the accepted answer by typing in the full path, but for that I got:

"...pyside.uic.exe is not a recognized as an internal or external command, operable command or batch file."

the other suggestions in that post (like using sudo install) didn't work for me since im on Windows, not linux. And I couldn't comment there (wanting to ask how to do it on windows) since I don't have enough rep.

So the bottom line is I just would like to get a .ui file (from QT Designer) to open up in maya via a generated .py file.

Trying to do it via PyQt4 only lands me in a failure to load DLL error, but trying to convert it to PySide is a problem because pyside-uic is not in my Python 27 scripts folder. I've been stuck here for a while now.

Anyone kind enough to offer some advice?

Thank you for your time.

Additional info:

I am using Maya 2016, running on a Windows 10 64 bit OS.
I have a Python 2.7 in my C: drive 
And I am now using PyQt4-4.10-gpl-Py2.7-Qt4.8.4-x64
I have a pyside and pysideuic folder inside Maya site packages folder
Community
  • 1
  • 1
Gogo
  • 53
  • 1
  • 2
  • 8

2 Answers2

1

You shouldn't need the exe.

does from pysideuic import compileUi work in your listener?

see : https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/Maya/files/GUID-FAD0F6CC-15D0-4489-9372-028146B70F49-htm.html

theodox
  • 12,028
  • 3
  • 23
  • 36
  • I've tried that before posting the question. I just keep getting: # Error: line 1: IOError: file line 9: 22 # – Gogo Feb 14 '17 at 01:52
  • Did you run the script from a mayapy commandline instance, like the link wants? – theodox Feb 14 '17 at 02:39
  • hi - thanks for your responses - and your patience. Unfortunately I'm in a spot where I didn't ask to be in - I'm completely unqualified in all this - but still just trying to learn what i can from scattered pieces of information online. that said - I have no idea what a mayapy commandline instance is - googling on it led me to a couple of blogs that just took me to a deeper direction that i cant comprehend. One of the blogs led me to discover a maya py. exe file in the bin folder - but when i try to run the example there - im getting an invalid module error – Gogo Feb 14 '17 at 04:28
  • so yeah sorry for being difficult - I'm still doing searches but - i get stuck at places where i dont undertand the information, like here for example: http://www.bewi.at/?p=245 - now im thinking if i should install pyside-tools? (since i found a pyside-uic file, not a .exe inside my maya bin folder) – Gogo Feb 14 '17 at 04:31
  • so `cd "C:\program files\autodesk\maya2016\bin"` followed by `mayapy pyside-uic ` does not work? It should print out what looks like a python file. You'd then pipe that into a new .py file – theodox Feb 14 '17 at 04:56
  • http://i990.photobucket.com/albums/af24/Themimegogo/ForumUse/1.jpg Nope didn't work. – Gogo Feb 14 '17 at 09:04
  • the cd and the mayapy.. etc should be on separate lines. The first is to get you into the maya bin directory; the second calls mayapy (which lives in bin) on the pyside-uic file (which also lives there). You can navigate there with explorer and use 'command window here' to avoid the CD – theodox Feb 14 '17 at 20:36
0

I wouldn't even bother trying to convert the ui files to python files. You can just load the ui files dynamically. In PyQt4, they had a function that would do this for you -- PyQt4.uic.loadUi. Pyside doesn't have that exact same function, but it has similar tools, and people have created a function that does essentially the same thing.

Also, you shouldn't be using your own installed PyQt4. Maya compiles their own version of Qt, which may not be compatible with your PyQt binaries. They provide their own compiled PySide binaries with Maya, so just use those.

Community
  • 1
  • 1
Brendan Abel
  • 35,343
  • 14
  • 88
  • 118
  • thanks for the response. I've already uninstalled pyQT4 - but right now the situation is - prior to doing anything - I kept getting the "no module named PyQt4" error. After I installed PyQt4 and copied it into the Lib Site packages folder in Maya - then I got it working at least (was that bad? because i have no idea how i was supposed to get it running in the first place). Anyway - I'm being instructed to convert it to .py but I just cant use psyideuic in the same way I just used pyuic4 in the command prompt. – Gogo Feb 14 '17 at 05:37
  • You're getting the no module named PyQt4 error because PyQt4 isn't installed in the maya python. Don't use PyQt4; don't copy it manually. Maya comes with PySide, use that. If you *must* convert it to .py files, inside the PySide folder there should be a `uic.py` script `/PySide/scripts/uic.py`. You should be able to use that the same way you did pyuic – Brendan Abel Feb 14 '17 at 08:37
  • http://i990.photobucket.com/albums/af24/Themimegogo/ForumUse/noPySideScripts.jpg Nope sorry - I looked at both Pyside and pysideuic folders inside my Maya location - as you can see - nothing there. Afterwards I tried to search for a uic.py - and my machine pointed me to a winexe folder left behind by the previous user of my machine - but it was named uic.pyo - I also checked the machines of two colleagues, they didnt have a scripts folder in PySide folders as well – Gogo Feb 14 '17 at 09:39
  • Hmm, odd. Try downloading and installing PySide to your system python (make sure it's 2.7, same as Maya). It should have that script – Brendan Abel Feb 14 '17 at 14:59