help to setup pyqt for maya 2014 under windows 7

73 views
Skip to first unread message

Gyurma

unread,
Jul 16, 2014, 9:52:13 PM7/16/14
to python_in...@googlegroups.com
Hi,

I'm not very familiar with how to set this up, I read a few things downloaded pyqt, installed but obviously not done it right because it does not work under maya.

when I do a simple 

from PyQt4 import QtCore, QtGui

it just says no such module. Probably missing some env var? Not sure as I never tried such setup but would be keen to use pyqt.

I'd really appreciate some help.

Thank You
Gyuri

Fredrik Averpil

unread,
Jul 16, 2014, 10:31:59 PM7/16/14
to python_in...@googlegroups.com
You'll have to compile PyQt:
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFHVYoSLHcoTcStZRMntddTvd9R6L7KMdXP4yH91289R3qiESg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Erkan Özgür Yılmaz

unread,
Jul 16, 2014, 10:37:07 PM7/16/14
to python_inside_maya

Is there any particular reason why you are not using PySide instead. It is already shipping with Maya, no need to compile anything.

Ozgur
eoyilmaz.blogspot.com

Siew Yi Liang

unread,
Jul 17, 2014, 12:16:33 AM7/17/14
to python_in...@googlegroups.com
I actually just copy the directories from PyQt4 from /lib/site-packages to Maya's own Python directory at:

C:\Program Files\Autodesk\Maya2013\Python\Lib\site-packages

It seems to be the most reliable result for me so far (using pyqt.pth files sometimes works/doesn't work based off the user PYTHONPATH env var, and I haven't bothered to figure out what exactly goes wrong, so I've taken to doing this instead for users and just running a robocopy batch script over the network for coworkers to copy over the necessary dependencies.)

Hope that helps!
Yours sincerely,
Siew Yi Liang

Justin Israel

unread,
Jul 17, 2014, 1:00:22 AM7/17/14
to python_in...@googlegroups.com

If you are using a standard install of PyQt within Maya, it has the potential to produce undefined results. It expects to be compiled against the same Qt version as Maya, which is also a modified version by Autodesk.

Gyurma

unread,
Jul 17, 2014, 4:21:13 AM7/17/14
to python_in...@googlegroups.com
Thank you,

I'll have a go at that. 
@Erkan Özgür Yılmaz no there is no particular reason only that I'm not a programmer and started with qt, qt designer under linux and familiar with it. that's all.

Thanks,
Gyuri



For more options, visit https://groups.google.com/d/optout.



--
Gyuri Kiss
www.gyurma.com

Erkan Özgür Yılmaz

unread,
Jul 17, 2014, 4:53:57 AM7/17/14
to python_inside_maya

PyQt4 and PySide are the same essentially and 99% of your code will work both in PyQt4 and PySide without any modification. So, my suggestion is to not to bother installing PyQt4 and go with PySide.

Ozgur
eoyilmaz.blogspot.com

Gyurma

unread,
Jul 17, 2014, 5:02:18 AM7/17/14
to python_in...@googlegroups.com
I'm happy not to start to build/compile (as I have very little experience. Ok so I need to look for some docs...

Thanks!
Gyuri



For more options, visit https://groups.google.com/d/optout.



--
Gyuri Kiss
www.gyurma.com

Justin Israel

unread,
Jul 17, 2014, 5:05:24 AM7/17/14
to python_in...@googlegroups.com
My favorite source of docs has been keeping the Qt Assistant app running while I code (comes with the Qt install). It is really simple to mentally translate the C++ syntax to PySide. Whenever they list special *List* return types, or instance, you know you will just get back a list. I usually have that up with the "Index" tab selected so I can search for types, which I can never remember :-)
 


Gyurma

unread,
Jul 17, 2014, 5:39:30 AM7/17/14
to python_in...@googlegroups.com
ok first problem I bumped into....

I supposed to translate my .ui file to .py via a translator ( http://qt-project.org/wiki/QtCreator_and_PySide

  1. pyside-uic mainwindow.ui  -o mainwindow.py

the closest I found to this is:
\Autodesk\Maya2014\Python\Lib\site-packages\pysideuic\pyside-uic.1

but that does not do the job.....

do I need to install pyside? Or (very likely) missing something?

Gyuri





For more options, visit https://groups.google.com/d/optout.



--
Gyuri Kiss
www.gyurma.com

Gyurma

unread,
Jul 17, 2014, 5:52:31 AM7/17/14
to python_in...@googlegroups.com
excuse my ignorance, I found the solution in the maya docs.....
--
Gyuri Kiss
www.gyurma.com
Reply all
Reply to author
Forward
0 new messages