2

This will be my first question. I have searched through the other questions but unfortunately none of them solved my problem(s).

I'm running 32-bit Python (2.7) on Win7. I want to install the PyQt4.

I have downloaded PyQt-win-gpl-4.11.4.zip and PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe files in: https://riverbankcomputing.com/software/pyqt/download link. It is written there: "Before you can build PyQt4 you must have already built and installed SIP". Hence, I downloaded "sip-4.16.9".

I followed those steps during the installation: http://pyqt.sourceforge.net/Docs/sip4/installation.html. I successfully executed configure.py script. However, when I tried to build SIP by running the make command, I have an infinite loop like given below:

C:\Python27\sip-4.16.9>make cd sipgen make make[1]: Entering directory '/c/Python27/sip-4.16.9' cd sipgen make make[2]: Entering directory '/c/Python27/sip-4.16.9' cd sipgen make make[3]: Entering directory '/c/Python27/sip-4.16.9'

... and so on endless

How can I solve this problem?

Thanks in advance.

selimcan
  • 84
  • 2
  • 9
  • Besides, when I directly went to sipgen (_C:\Python27\sip-4.16.9\sipgen_) directory and call makefile from there, I got this error: `Makefile:19: *** missing separator. Stop`. Can my problem be related to this? – selimcan Oct 20 '15 at 14:36
  • You don't need to build anything. All you need to do is run the binary installer (i.e. the exe file you have already downloaded). – ekhumoro Oct 20 '15 at 16:08
  • I have already downloaded and installed _PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe_ file before I have tried to build PyQt4. However, I get this error when I run my Python script: `from PyQt4.QtGui import QPushButton, QGridLayout, QTextEdit, QComboBox, QWidget, QApplication, QLabel, QCheckBox, QFileDialog ImportError: DLL load failed: %1 is not a valid Win32 application.` That's why I tried to build PyQt4 and SIP. Any ideas why I get this error message? – selimcan Oct 21 '15 at 07:38
  • 2
    That error indicates you have mixed 64bit and 32bit packages. – ekhumoro Oct 21 '15 at 15:23
  • Thank you ekhumoro! The problem is exactly what you mentioned. I have to install 64-bit versions of PyQt4 and Python2.7. – selimcan Oct 22 '15 at 07:38

2 Answers2

0

Usually I install PyQt4 via Christoph's excellent site.

I tried:

C:\Users\user\Downloads>pip install instPyQt4-4.11.4-cp27-none-win_amd64.whl

but it told me my system isn't supported. Doing the same for the 32bit one resulted in the same error.

So I tried from source and hit the same problem in this question. After reading the 64bit problem highlighted by ekhumoro I realized that the python downloads page seems to download 32bit by default even though my OS is 64bit. Python2.7 64-bit is available here. What I did is uninstall the 32bit one fist so that the 64bit one can take its place (no need to set up envirnment variables again). After this I tried installing the .whl agani as shown above and this time it worked.

Community
  • 1
  • 1
Frikster
  • 2,755
  • 5
  • 37
  • 71
0

When the same problem occurred, I was able to solve the problem.

python configure.py --platform win32-g++
mingw32-make
mingw32-make install

However, the next step is still unclear.

Duhee
  • 1
  • 1