Linux下源码安装PyQt4
来源:互联网 发布:网络ssc什么意思 编辑:程序博客网 时间:2024/06/04 18:30
感谢朋友支持本博客,欢迎共同探讨交流,由于能力和时间有限,错误之处在所难免,欢迎指正!
如果转载,请保留作者信息。
博客地址:http://blog.csdn.net/qq_21398167
从官网上下载PyQt的源码:
http://www.riverbankcomputing.com/software/pyqt/
官网上说:“Before you can build PyQt4 you must have already built and installed SIP” 意思是说必须先安装SIP,于是也下载了SIP。
解压SIP压缩包,进入源码目录,打开README,说是当前目录下有一个build.py,结果我没有找到。但找到了一个configure.py的代码。于是我执行它
$ python configure.py
正常完成,并生成了Makefile。我下意识地执行make,结果:
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
通常这种问题出在系统没有安装组件的开发板,只提供了库文件,并没有提供对应的头文件,不能进行二次开发。解决文件就是安装python-devel
$
sudo
yum
install
python-devel
完成安装。再make,顺利通过编译。再sudo make install,也很顺利。测试是否完成安装:
$ 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]
安装OK。
解压下载的:PyQt-x11-gpl-4.10.3.tar.gz
ImportError: No module named QtWebKit
进入源码目录,打开README,按说明的步骤:先执行configure-ng.py脚本,然后make,make install。
因为我在使用 eric4 的时候 出现错误
$ 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
由于这是GPL,所以在执行configure-ng.py时让我们同意协议。输入yes继续。
用了1min顺利完成!接着make,这个过程有一点长,花了20分钟,很顺利。
- Linux下源码安装PyQt4
- Linux下安装PyQt4
- fedora下安装pyqt4
- pyqt4安装 Linux
- 关于linux下 Python PyQt4安装的种种坑
- SLES11下安装PyQt4.94
- ubuntu下配置安装PYQT4
- ubuntu下配置安装PYQT4
- Windows下PyQt4的安装
- Windows下PyQt4的安装
- Windows下PyQt4的安装
- Windows 下 PyQt4 的安装
- ubuntu下配置安装PyQt4
- linux下源码安装
- Ubuntu下安装Qt4和PyQt4
- CentOS7.1下python2.7.10安装PyQt4
- Windows+Python 3.6环境下安装PyQt4
- pyQt4 安装
- ssi框架学习总结
- 05快速排序
- 委托与接口之我看
- android ListView的分段显示、分页显示
- 为什么使用MAVEN 3.2.1会有版本问题?
- Linux下源码安装PyQt4
- 剑指offer 8 - 旋转数组的最小数字
- 可不可以在局域网编译TINY?
- user-agent概括
- Android 内存优化
- 在INSTALL TINY时出现下面的问题怎么办?
- wavein录音程序
- Unity3D游戏开发之使用Mecanim动画系统控制2D动画
- 转 Grand Central Dispatch 基础教程:Part 1/2 -swift