Convert Qt5's widget to use inside maya

77 views
Skip to first unread message

illunara

unread,
Apr 3, 2019, 6:15:01 AM4/3/19
to Python Programming for Autodesk Maya
Hi everybody
I follow this guide to convert a Qt's widget wrote in C++ into python

But i got error, told me that sipconfig is missing while running configure.py
import os, sipconfig, sys

What is this sipconfig and how can i get it?
Thanks

Justin Israel

unread,
Apr 3, 2019, 2:36:56 PM4/3/19
to python_in...@googlegroups.com
sip is the C++ to Python binding generator used by PyQt. It is the equivalent of shiboken for PySide


Thanks

--
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/4f6dc024-8b05-48ab-bc78-928fa2800c71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

em.l...@gmail.com

unread,
Apr 3, 2019, 2:55:15 PM4/3/19
to Python Programming for Autodesk Maya
Hi Justin
I installed Python 3.4, and use Pip to get PyQt5 and sip(Same package as you mention above) for convert a C++ Widget into PyQt's. I follow the guide in the link, but when i tried to run the first line python confingure.py, it told me the sipconfig's package is missing.

I'm not sure what is this package is, or how to get it. Or if you have any guide to convert a QT's widget to Pyqt, it would be awesome


Justin Israel

unread,
Apr 3, 2019, 3:22:39 PM4/3/19
to python_in...@googlegroups.com
It's not really a problem with a Qt5 to PyQt tutorial. It's an issue with finding sip in your Python3 PYTHONPATH. I would recommend simplifying your approach and finding out why your installed sip isn't found. Run the python3 interpreter from the command line and try to import sip and sipconfig. Check your PYTHONPATH and make sure it's in the right place. Maybe you accidentally used a python2 pip. Post your install commands here if you want someone to check. 



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

Tuan Nguyen

unread,
Apr 3, 2019, 10:55:59 PM4/3/19
to python_in...@googlegroups.com
Here is what i have done so far : 
- Install python3.5 x64 win7
- Install sip : pip3 install sip
Install was success, i able to import sip using python, however it raise error when import sipconfig : "ImportError : No module named sipconfig"
- I also install PyQt5 : pip3 install PyQt5



You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/gL-A68ivfbg/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAPGFgA1HffVyvDNU_OaKgMHg6TmRQn8jppFoGw6CskFj6qM8Bw%40mail.gmail.com.

Justin Israel

unread,
Apr 3, 2019, 11:55:29 PM4/3/19
to python_in...@googlegroups.com
On Thu, Apr 4, 2019 at 3:55 PM Tuan Nguyen <cb.il...@gmail.com> wrote:
Here is what i have done so far : 
- Install python3.5 x64 win7
- Install sip : pip3 install sip

I think this is your issue. 'sip' is the older PyQt4 package. If you look at the link I showed you earlier, the PyQt5 variation is called "PyQt5-sip".
Also, apparently the preferred newer way to use pip is to call it through the python interpreter:

    python3 -m pip install PyQt5-sip

This approach would ensure that you aren't accidentally using a 'pip' command that is built around some unexpected version of python.


Tuan Nguyen

unread,
Apr 4, 2019, 1:07:51 AM4/4/19
to python_in...@googlegroups.com
Hi Justin
I did like you mention above but end up with same result, no sipconfig package is found. Also the PyQt5-sip has already inside PyQt5, i can import sip after pull the PyQt5 packaged.

I just found this article https://riverbankcomputing.com/pipermail/pyqt/2016-July/037729.html
It said that :
sipconfig.py is deprecated and does not support PyQt5
Maybe this is the reason?



Justin Israel

unread,
Apr 4, 2019, 1:43:35 AM4/4/19
to python_in...@googlegroups.com
On Thu, Apr 4, 2019 at 6:07 PM Tuan Nguyen <cb.il...@gmail.com> wrote:
Hi Justin
I did like you mention above but end up with same result, no sipconfig package is found. Also the PyQt5-sip has already inside PyQt5, i can import sip after pull the PyQt5 packaged.

I just found this article https://riverbankcomputing.com/pipermail/pyqt/2016-July/037729.html
It said that :
sipconfig.py is deprecated and does not support PyQt5
Maybe this is the reason?

That's strange that the Qt5toPyQt5 project you referenced makes use of sipconfig for Qt5, with updates as recent as a year ago, yet that message from that 2016 link says it doesn't support PyQt5. It must have at some point for this project to have worked.

I don't have any experience creating sip bindings, so I don't know what to suggest as a replacement.
 
Reply all
Reply to author
Forward
0 new messages