pyqt sip5安装前必须安装sip吗

Demidroid 的BLOG
用户名:Demidroid
文章数:48
访问量:18052
注册日期:
阅读量:5863
阅读量:12276
阅读量:289597
阅读量:1013637
51CTO推荐博文
下载 PyQt5 source & ,sip source & ,Qt5&& & 2. 安装 sip&&&&&&tar -zxvf&sip-4.16.3.tar.gz& & &cd&sip-4.16.3& & &python configure.py&&&& make& & &sudo make install&&&3.安装Qt5& &4.安装Pyqt5&&&&tar -zxvf PyQt-gpl-5.3.2.tar.gz&&&&cd PyQt-gpl-5.3.2&&&&sudo python configure.py -q /Users/boteng/Qt/5.3/clang_64/bin/qmake -d &&&&&&&&/Library/Python/2.7/site-packages/ --sip &&&&&&&&&&&&/System/Library/Frameworks/Python.framework/Versions/2.7/bin/sip --verbose问题Project ERROR: Could not resolve SDK path for 'macosx10.8'解决办法~/Qt/5.3/clang_64/mkspecs/qdevice.prichange the following line:!host_build:QMAKE_MAC_SDK&=&macosx10.8to this:!host_build:QMAKE_MAC_SDK&=&macosx10.9sip/QtPrintSupport/qprinter.sip:28:10: fatal error: 'qprinter.h' file not found最后还没找到如何修改使用brew 安装 &前提需要安装python 3brew install -v pyqt5Installing PyQtYou will need the latest version of Python(currently 3.3.3). Make sure this is installed and that you add the executable to the system path. This option is automatically available from within the installer.本文出自 “” 博客,请务必保留此出处
了这篇文章
类别:┆阅读(0)┆评论(0)Ubuntu 12.10下搭建PyQt环境_Linux教程_Linux公社-Linux系统门户网站
你好,游客
Ubuntu 12.10下搭建PyQt环境
来源:Linux社区&
作者:redfish
在 12.10下搭建PyQt环境。
安装Python(由于此版本默认有Python2.7和Python3.2故可省去)
第一步:下载
第二步:下载( SIP is a tool forautomatically generating Python bindings for C andC++ libraries)
第三步:下载
第四步:配置SIP:
解压sip-XXXXX.tar.gz压缩包,进入sip-XXXXX目录
python configure.py
注意:If you have multiple versions of Python installed then make sure
you use theinterpreter for which you wish SIP to generate bindings for.
也就是说我采用Python3.x进行开发,那么使用的命令是:python3 configure.py
shell下的结果是:
lieo@ubuntu:~/download/sip-4.14.2$ python3 configure.py This is SIP 4.14.2 for Python 3.2.3 on linux2.The SIP code generator will be installed in /usr/bin.The sip module will be installed in /usr/lib/python3/dist-packages.The sip.h header file will be installed in /usr/include/python3.2mu.The default directory to install .sip files in is /usr/share/sip.
注意: 这步可能会报找不到Python.h文件的错误(没报错跳到make install)
这是因为缺失头文件和静态库包,
假如使用python2.7运行
sudo apt-get install python-dev
假如使用python3运行
sudo apt-get install python3-dev
make install
第五步:编译安装Qt4
Ubuntu默认没有编译环境,运行以下命令安装编译环境
sudo apt-get install build-essential
#进入qt源码目录运行
./configure
结果:Qt will be installed into /usr/local/Trolltech/Qt-4.8.4
makemake install
1.如果在./configure阶段,出现了以下错误 Basic XLib functionality test failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 那是因为没装有libxtst-dev,使用命令apt-get install libxtst-dev安装
2.如果在make阶段,出现一下错误
/usr/bin/ld: cannot find -lXrender make[1]: *** [../../../../lib/libQtWebKit.so.4.7.3] 错误 1
make: *** [sub-webkit-make_default-ordered] 错误 2
那是因为没有装libxrender-dev
3.在qt create中,尝试编译测试,如果找不到qmake,则在工具-选项-QT4中手动设置qmake的位置。qmake的位置默认在/usr/local/Trolltech/Qt-4.8.4/bin/qmake。
当这几个步骤全部完成后,把&PATH=/usr/local/Trolltech/Qt-4.8.4/bin:$PATHexport PATH&加到.profile中,Qt就安装成功了。或者 在.bashrc文件(如果你的shell是bash、ksh、zsh或者sh)中,添加下面这些行: QTDIR=/usr/local/Trolltech/Qt-4.8.4PATH=$QTDIR/bin:$PATHLD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
第六步:安装PyQt
#进入PyQt源码目录运行以下命令安装PyQt#前提是Qt4和SIP以正确安装python configure.pymakemake install
至此配置完成
相关资讯 & & &
& (03/17/:02)
& (10/04/:44)
& (05/29/:23)
& (01/09/:47)
& (10/04/:49)
图片资讯 & & &
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅读并接受上述条款}

我要回帖

更多关于 pyqt4 sip 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信