Date: -01-25| Tags:,| Update 1/10/2008: PyQt has made the install process a lot simpler because it has bundled everything you need in one installer including QT 4.3 open source edition. Now all you need to do is install Python and the PyQt bundle. Immediately following are the updated steps. Below that is the old instructions. Update 7/1/2008: Updated for PyQt 4.4.2 NEW INSTRUCTIONS Here are the steps to install and create a simple 'Hello World' GUI application using PyQt 4.4, and Python 2.5, on Windows. ![]() You at the time of purchase. Before you can build PyQt4 you must have already built and installed SIP. Binary installers for Windows are no longer provided. Install Python 2.5 • Go to and click on 'Python 2.5.x Windows installer' • Save and run the Windows installer • Go through the steps and accept the defaults. Install the PyQt 4.4 bundle (including QT 4.4) • Go to and select the 'PyQt-Py2.5-gpl-4.4.2-1.exe' link. • Save and run the file. • Go through the steps and accept the defaults. Run a 'Hello World' application • Go to 'Start' -> 'All Programs' -> 'Python 2.5' -> 'IDLE (Python GUI)' • Open a new window ('File' -> 'New window') • Type the following code inside and save: import sys from PyQt4.QtGui import * app = QApplication(sys.argv) button = QPushButton('Hello World', None) button.show() app.exec_() • Hit 'F5' to run. A window with a single push button should pop up.
For more examples, go to 'Start' -> 'All Programs' -> 'PyQt GPL v4.4.2 for Python v2.5' > 'Examples' > 'PyQt Examples Source' (For a default installation, this is also located at C: Python25 PyQt4 examples.) To start, look in the 'tutorial' directory. OLD INSTRUCTIONSHere are the steps to install and create a simple 'Hello World' GUI application using PyQt 4.1.1, Python 2.5, and QT 4.2.2 Open Source edition (GPL) on Windows XP with the MinGW compiler. Install Python 2.5 • Go to and click on 'Python 2.5 Windows installer' • Save and run the Windows installer • Go through the steps and accept the defaults. Install MinGW • Go to • Download the following 'bin' files from the 'Current' section: • gcc-core-3.4.2-20040916-1.tar.gz • gcc-g++-3.4.2-20040916-1.tar.gz • mingw-runtime-3.9.tar.gz • w32api-3.6.tar.gz • Extract all the files to 'c: mingw' Install QT 4.2.2 Open Source edition • Go to the Open Source download page at. Note there is also an Evaluation version. This is *not* the one you want. • Under the 'Download' heading, select the 'link. • Go through the steps and accept the defaults. • When you get to the MinGW page, leave the 'Download and install minimal MinGW installation' box unchecked and make sure the location of the MinGW installation is set to 'c: mingw'. Click 'Install'. • You will get an error message which says that the installer could not find a valid 'w32api.h' file. You can install the 3.2 version from the mingw site, but the 3.6 version works. Click 'Yes' to continue. Click 'Finish' to finish the installation. Install PyQt 4.1.1 • Go to and select the 'PyQt-gpl-4.1.1-Py2.5-Qt4.2.2.exe' link. • Save and run the file. • Go through the steps and accept the defaults. Comments Anonymous commented on 2007-02-03: Thank you for perfect instruction. The qt-win-opensource-4.2.2-mingw.exe 'Download and install minimal MingGW' option worked just fine. This seems simpler to me. Thank you for this post/guide. Commented on 2007-03-05: I'm glad the post was helpful. For me, 'from PyQt4.Qt import *' didn't work. I'm not sure what the difference is. Also, it is great if the 'Download and install minimal MingGW' option works for you. Sketchup 5 free download crack winzip.
0 Comments
Leave a Reply. |