2014-06-08 101 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步驟操作即可。