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.
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.c
siplib.c:20:20: fatal error: Python.h: No such
file
or directory
#include <Python.h>
^
compilation terminated.
make
[1]: *** [siplib.o] Error 1
make
[1]: Leaving directory `
/home/hevake_lcj/Install/qt-downloads/sip-4
.15.3
/siplib
‘
make
: *** [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 |
$ sudo yum install python-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 -h
Usage:
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
file
the name of the QScintilla API
file
[default not generated]
-b
file
the name of the build
file
[default none generated]
-c
dir
the name of the code directory [default not generated]
-d
file the name of the documentation
file
(deprecated) [default not generated]
-e
enable
support
for
exceptions [default disabled]
-g always release and reacquire the GIL [default only when specified]
-I
dir
look
in
this directory when including files
-j
# split the generated code into # files [default 1 per class]
-k support keyword arguments
in
functions and methods
-m
file
the name of the XML
export file
[default not generated]
-o
enable
the automatic generation of docstrings [default disabled]
-p module the name of the consolidated module that this is a component of
-P
enable
the protected
/public
hack
-r generate code with tracing enabled [default disabled]
-s suffix the suffix to use
for
C or C++
source
files [default
".c"
or
".cpp"
]
-t tag the version
/platform
to generate code
for
-T disable the timestamp
in
the header of generated files
-w
enable
warning messages
-x feature this feature is disabled
-X
id
:
file
create the extracts
for an
id
in
a
file
-z
file
the name of a
file
containing
more
command
line flags
file
the 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 Public
License)
for
Python 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