Important: Please read the Qt Code of Conduct -

PyQt4 installation process (Error)

  • Hi

    I am having trouble with installing PyQt4 on Windows 10. I have tried to solve the problem for many days now, but still haven't figured it out.
    So I downloaded PyQt4 zip and extracted it to the drive. When I try to run a command "python" in PS it gives me an error "Error: Make sure you have a working Qt qmake on your PATH." although I have QT installed. I have tried to copy "qmake.exe" to the folder where I am running the "python", but still the same error.

    I also tried the second option, running "python", but then I get an error "No module named 'sipconfig'" I have Googeled that it is caused, cause SIP isn't installed. So I downloaded SIP zip and tried to install SIP from PS. First I executed a command "python --platform win32-g++" from the folder where I extracted the SIP files. Then I executed a command "C:\MinGW\bin\mingw32-make.exe" cause just command "make" does not work. But then I got an error

    PS G:\Programmeerimine\uus\Lib\site-packages\PyQt4_gpl_win-4.12.1\sip 4.19.7> C:\MinGW\bin\make.exe
    make[1]: Entering directory 'G:/Programmeerimine/uus/Lib/site-packages/PyQt4_gpl_win-4.12.1/sip-4.19.7/sipgen'
    gcc -c -O2 -Wall -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o main.o main.c
    gcc: error: CreateProcess: No such file or directory
    Makefile:29: recipe for target 'main.o' failed
    make[1]: *** [main.o] Error 1
    make[1]: Leaving directory 'G:/Programmeerimine/uus/Lib/site-
    Makefile:3: recipe for target 'all' failed
    make: *** [all] Error 2

    Really looking forward hearing your answers. Thank you in advance!

  • Lifetime Qt Champion

    @Programmer-hunt No need to copy qmake.exe, just do what PyQt suggests: add the path containing qmake.exe to your PATH environment variable.

  • Thank you for your response. But I do not understand fully. You mean adding "--qmake PATH or -q PATH to the command? If yes, it does not work in Windows "This option is not available on Windows where qmake must be on PATH."
    So I'd ask what exactly means "be on PATH"?
    My OS is installed on partition C, QT is insalled on partition D (D:\Rakendused\QT_uus) and I try to run from partition D (D:\Programmeerimine\PyQt4_gpl_win-4.12.1)

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    They mean that you have to modify the PATH environment variable and add the folder where qmake is to it. However do it only for the command line you are currently using.

    Something like: set PATH "%PATH%;D:\Rakendused\QT_uus\5.10.0\mingw_32\bin\"

  • Lifetime Qt Champion

    @Programmer-hunt PATH is an environment variable containing paths to directories where the system looks for executables.
    If you execute qmake.exe in a terminal then the system looks in these directories until it find one which contains qmake.exe and then it starts qmake.exe from this directory.
    You need to add the path to the directory which contains qmake.exe to this variable.
    This way you can see what it currently contains:

    echo %PATH%

    To add a directory:


    Please replace the path with the one which matches your Qt setup.

  • Really thank you guys for making it clearer for me. I do not know how I did not understand it the first time ☺. So I got pass this error and now I have another error.
    In QT\5.10.0 I have many versions. 0_1516970806462_193cde99-f4c9-4975-8f03-fcba106f3df8-image.png

    G:\Programmeerimine\uus\Lib\site-packages\PyQt4_gpl_win-4.12.1>python --verbose
    Querying qmake about your Qt installation...
    Determining the details of your Qt installation...
    G:\Rakendused\QT_uus\5.10.0\winrt_x86_msvc2017\bin\qmake.exe -spec win32-msvc2015 -o
    Could not find qmake configuration file win32-msvc2015.
    Error processing project file:
    Error: Failed to determine the detail of your Qt installation. Try again using
    the --verbose flag to see more detail about the problem.

  • Lifetime Qt Champion

    Why not build PyQt5 ? I'm not sure PyQt4 supports such a recent version of Qt.

  • Lifetime Qt Champion

    @Programmer-hunt said in PyQt4 installation process (Error):


    It calls wrong qmake.exe. Are you sure you didn't add G:\Rakendused\QT_uus\5.10.0\winrt_x86_msvc2017\bin to PATH?
    You should use msvc2015 Qt as it looks like this is one expects.

  • Really appreciate your help. Got it working with a earlier version. Again, real thanks to you guys! :)

  • @Programmer-hunt I'm having the exact same issues. What earlier version qmake.exe did you use that got it to work?

Log in to reply