Linux under the source installation PyQt4

Source: Internet
Author: User

Download PYQT's source code from official website:

http://www.riverbankcomputing.com/software/pyqt/

Official online said: "Before you can build PyQt4 you must has already built and installed SIP" means that you must first install SIP, so also download sip.

Decompression SIP compressed packet, enter the source directory, open the Readme, said is the current directory has a build.py, the results I did not find. But a configure.py code was found. So I executed it.


1 $ python configure.py

Completed normally, and generated a makefile. I subconsciously performed make, and the result:


12345678 gcc-c -pipe -fPIC -O2 -w -DNDEBUG -I. -I/usr/include/python2.6 -o siplib.o siplib.csiplib.c:20:20: fatal error: Python.h: No such fileor directory #include <Python.h>                    ^compilation terminated.make[1]: *** [siplib.o] Error 1make[1]: Leaving directory `/home/hevake_lcj/Install/qt-downloads/sip-4.15.3/siplibmake: *** [all] Error 2

Usually this problem in the system does not install the components of the Development Board, only provides the library files, and does not provide the corresponding header files, can not be developed two times. The solution file is to install Python-devel


1 sudoyum installpython-devel

Complete the installation. Make again, and pass the compilation successfully. Then sudo make install, also very smooth. To test whether the installation is complete:


12345678910111213141516171819202122232425262728 $ sip -hUsage:    sip [-h] [-V] [-a file] [-b file] [-c dir] [-d file] [-e] [-g] [-I dir] [-j #] [-k] [-m file] [-o] [-p module] [-P] [-r] [-s suffix] [-t tag] [-T] [-w] [-x feature] [-X id:file] [-z file] [file]where:    -h          display this help message    -V          display the sip version number    -a filethe name of the QScintilla API file[default not generated]    -b filethe name of the build file[default none generated]    -c dirthe name of the code directory [default not generated]    -d file the name of the documentation file(deprecated) [default not generated]    -e          enablesupport forexceptions [default disabled]    -g          always release and reacquire the GIL [default only when specified]    -I dirlookinthis directory when including files    -j #        split the generated code into # files [default 1 per class]    -k          support keyword arguments infunctions and methods    -m filethe name of the XML export file[default not generated]    -o          enablethe automatic generation of docstrings [default disabled]    -p module   the name of the consolidated module that this is a component of    -P          enablethe protected/publichack    -r          generate code with tracing enabled [default disabled]    -s suffix   the suffix to use forC or C++ sourcefiles [default ".c"or ".cpp"]    -t tag      the version/platformto generate code for    -T          disable the timestamp inthe header of generated files    -w          enablewarning messages    -x feature  this feature is disabled    -X id:filecreate the extracts for an idinfile    -z filethe name of a filecontaining morecommandline flags    filethe name of the specification file[default stdin]

Install OK.


Unzipped downloaded: pyqt-x11-gpl-4.10.3.tar.gz

Enter the source directory, open the Readme, follow the instructions: Execute the configure-ng.py script first, then Make,make install.


123456789101112 $ python configure-ng.py Querying qmake about your Qt installation...Determining the details of your Qt installation...This is the GPL version of PyQt 4.10.3 (licensed under the GNU General PublicLicense) forPython 2.6.6 on linux2.Type ‘2‘to view the GPL v2 license.Type ‘3‘to view the GPL v3 license.Type ‘yes‘to accept the terms of the license.Type ‘no‘to decline the terms of the license.Do you accept the terms of the license? yes



Since this is the GPL, let us agree to the agreement when executing the configure-ng.py. Enter Yes to continue.

1min completed successfully! Then make, the process was a little long and took 20 minutes and went well.


Linux under the source installation PyQt4

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.