Sergio
Sergio

Reputation: 21

Qt Programming with Python, Installation and Environment

I have been using the Qt C++ framework and now I need to switch to PyQt to use the Python programming language instead. However I am having some trouble installing PyQt on Windows.

I have tried to follow this link: http://blog.oak-tree.us/index.php/2009/05/12/pyqt-windows ANd when I get to the point where I have to enter in the command line: "mingw32-make" (without quotation marks)

I get an error that says 'mingw32-make' is not recognized as an internal or external command, operable program or batch file

Has anyone successfully installed everything needed to be able to develop Qt GUI applications on Windows with Python and can give me some guidance? As I mentioned I already had the Qt SDK installed and working. So I just downloaded Python 2.6.6, PyQt 4.8.3 and Sip 4.12.2. But I don't know how to install all these tools to get something working. Any help will be appreciated.

Thanks.

Upvotes: 2

Views: 3836

Answers (3)

Gary Hughes
Gary Hughes

Reputation: 4510

It's best to call mingw32-make.exe from the Qt Command Prompt when installing PyQt4 from source. I had quite a few things in my path that interfered, and a few things missing from my path. The Qt Command Prompt sets up the environment for compiling for you.

Shameless plug, but I wrote a guide on setting up the Poppler library on Windows that also covers installing SIP and PyQt4. Just ignore the Poppler parts and follow steps 3, 4 and possibly 7 if you need QScintilla as well.

Upvotes: 1

Sridhar Ratnakumar
Sridhar Ratnakumar

Reputation: 85312

To quote (and rephrase) a related answer:

This may read like your grandpa givin advice, but all answers here did not mention the best way: go nd install ActivePython instead of python.org windows binaries. I was really wondering for a long time why Python development on windows was such a pita - until I installed activestate python. I am not affiliated with them. It is just the plain truth. Write it on every wall: Python development on Windows = ActiveState! you then just pypm install pyqt4 and everything works smoothly. no compile orgy. no strange errors. no terror. Just start coding anddoing real work after five minutes. This is the only way to go on windows. Really.

Upvotes: 0

Mike Ramirez
Mike Ramirez

Reputation: 10970

Well, you're in luck of sorts. PyQt distributes binaries that include everything but the docs and source. You will also need/want the sip packages also. Get the PyQt installer for the for the python version you want, in this case 2.6, but I would advise an upgrade to 2.7 if you can (barring and spec related issues with your job). This will get you up and running with pyqt in a matter of moments. This is the best solution IMO. This is what I do, Phil, the PyQt maintainer, keeps these up to date all the time for both x32 and x64 bit machines.

Now the problem with what you're doing is that mingw32-make.exe is probably not in your PATH environment variable and need to call it directly. which is located here with the QT SDK release 5/2010: C:\Qt\2010.05\mingw\bin

Personally, I find it's over rated to build PyQt from source, the binaries include all the dll's and everything you would need, except the docs. For which you can read on the web and use Qt's supplied docs.

Upvotes: 2

Related Questions