Problem with 'QtGui' and PyQt4


I’m a complete newbie with Python, and I need to use a program for one of my modding project.

The program is called “obj2bdl” and can convert .obj files into .bdl files, which are the model files that are used in the Super Mario Galaxy games on WII.

This tool only works with Python, it is pretty old (2013) and there is 0 documentation about it.

I just know that I need “PyQt4” to run it, so I’ve downloaded it and I typed this command:

python -c "import PyQt4

But when I run the program with IDLE Shell, I have this error:

cannot import name ‘QtGui’ from ‘PyQt4’

So I made researches, and it seems I need something else called “sip”. And when I search tutorials on how to install it, they talk to me like if I was an expert of Python xD

What do I need to install and where? Do I have to type specific commands? Do I need a specific version of PyQt4? I have no clue of what to do :eyes:

Can you explain me with simple words how to fix my problem ? :slight_smile:

Thanks a lot!

The latest version is PyQt6. PyQt5 is still supported.
But i have not seen a PyQt4 for a long time.

Where did you get PyQt4 from? It should have come with the version of sip that it needs.
On what OS are you using for this? Windows or Linux?

Yeah, the tool I want to use a little bit old and asks me to use PyQt4 ^^

But maybe it will work with PyQt6 ?

I’m on Windows 10, and I downloaded PyQt4 here: Riverbank Computing | Download

You have the best source for PyQt4. It should have the sip in the zip file.

PyQt4 code needs porting to later versions, its very unlikely to work with later versions.

You would be better off dropping the gui code and extract the conversion code to use in a command line program.

Oh and do not try running the program from inside idle.
Just run it from the cmd prompt.

Yep sip is inside!

Do I have something special to do with it?

Hehe how do I do that ? :stuck_out_tongue:

Sorry, I’ve literally started Python 5 hours ago only to run the program I need, I don’t even have the basics ^^

Ok you need step by step instructions to get this going.
I am not in front of a windows system to do that at the moment.

Yes don’t worry, thanks a lot for trying to help me ^^

As an IDLE maintainer, I quite support people using it for its intended purpose of learning Python and writing Python programs. But if you are not trying to edit obj2bdl and there is no issue of needing IDLE’s better non-ascii support, I agree with running directly from a command line. If you start IDLE normally, there should be no difference, but occasionally there is.

I found a tool that doesn’t require Python, thanks for your help anyway!