PyQt4 installation process (Error)
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 configure-ng.py" 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 configure-ng.py", but still the same error.
I also tried the second option, running "python configure.py", 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 configure.py --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: 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: *** [main.o] Error 1 make: Leaving directory 'G:/Programmeerimine/uus/Lib/site- packages/PyQt4_gpl_win-4.12.1/sip-4.19.7/sipgen' Makefile:3: recipe for target 'all' failed make: *** [all] Error 2
Really looking forward hearing your answers. Thank you in advance!
@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 configure-ng.py from partition D (D:\Programmeerimine\PyQt4_gpl_win-4.12.1)
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.
set PATH "%PATH%;D:\Rakendused\QT_uus\5.10.0\mingw_32\bin\"
@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:
To add a directory:
PATH=%PATH%;c:\Qt\5.9\bin python configure-ng.py
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.
G:\Programmeerimine\uus\Lib\site-packages\PyQt4_gpl_win-4.12.1>PATH=%PATH%;G:\Rakendused\QT_uus\5.10.0\mingw53_32\bin G:\Programmeerimine\uus\Lib\site-packages\PyQt4_gpl_win-4.12.1>python configure-ng.py --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 qtdetail.mk qtdetail.pro Could not find qmake configuration file win32-msvc2015. Error processing project file: qtdetail.pro Error: Failed to determine the detail of your Qt installation. Try again using the --verbose flag to see more detail about the problem.
Why not build PyQt5 ? I'm not sure PyQt4 supports such a recent version of Qt.
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 configure-ng.py 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?