2014-06-08 25 views
1

我在redhat 6上构建了pyqt4python2.7。我已经从源代码安装了python2.7,对于我尝试过的其他方法都可以正常工作。当我运行python2.7 configure.py,我得到以下错误:无法在Linux上构建PYQT

\# python2.7 configure.py 

确定你的Qt的安装布局...
错误:无法确定您的Qt的安装布局。请尝试使用--verbose标志 再次查看有关该问题的更多详细信息。

我读过,解决这个问题的方法是,发出以下命令,这似乎工作:

\# python2.7 configure.py --qmake /usr/bin/qmake-qt4 -g 

这成功完成。但是当我运行make时,出现以下错误。

make[1]: Entering directory /root/Downloads/PyQt-x11-gpl-4.11/qpy<br /> 
make[2]: Entering directory /root/Downloads/PyQt-x11-gpl-4.11/qpy/QtCore<br /> 
g++ -m64 -Wl,-O1 -o w_qpycore  -lQtGui -lQtCore -lpthread<br /> 
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o:<br /> 
In function _start: (.text+0x20): undefined reference to main<br /> 
collect2: ld returned 1 exit status<br /> 
make[2]: [w_qpycore] Error 1<br /> 
make[2]: Leaving directory /root/Downloads/PyQt-x11-gpl-4.11/qpy/QtCore<br /> 
make[1]: \*\*\* [all] Error 2<br /> 
make[1]: Leaving directory /root/Downloads/PyQt-x11-gpl-4.11/qpy<br /> 
make: \*\*\* [all] Error 2<br /> 

感谢您的任何帮助。 - 马克

回答

1

与您有同样的问题。告诉我们应该用“configure-ng.py”来代替,但是当我跑,我得到这个错误:

Querying qmake about your Qt installation... 
    Determining the details of your Qt installation... 
    An internal error occured. Please report all the output from the program, 
    including the following traceback, to [email protected] 
    Traceback (most recent call last): 
     File "configure-ng.py", line 2816, in <module> 
     main(sys.argv) 
     File "configure-ng.py", line 2780, in main 
     target_config.from_introspection(opts.verbose, opts.debug) 
     File "configure-ng.py", line 695, in from_introspection 
     self.qt_shared = (lines[1] == 'shared') 
    IndexError: list index out of range 

编辑 - 想通了。

原来我在本地安装了Qt 4.6,安装程序期望Qt 4.7+(尽管错误消息没有说明)。我使用这些存储库(在CentOS 6工作)安装的Qt 4.8:https://lists.fedoraproject.org/pipermail/fedora-kde/2013-March/012437.html

添加这些回购协议后,我只是做了百胜安装QT QT-devel的,它从4.6升级我的Qt - > 4.8

后在本地获取Qt 4.8,cd到PyQt4源文件和:

1. python configure-ng.py 
    2. make 
    3. make install 

EDIT2:原来我们需要Qt 4.7在工作。经过一番研究,结果发现这些版本都快乐起来:

PyQt 4.10.4 
    SIP 4.15.4 
    QT 4.7.4 

的Qt 4.7的RPM可以在这里找到:http://joseph.freivald.com/linux/2011/09/23/qt-4-7-4-and-qt-creator-2-3-0-for-centosrhel-5/

PyQt的4.11不与Qt的4.7工作(至少对我来说,我对CentOS 6.4) 使用这些版本,只需按照上面的1,2,3步骤操作即可。