簡體   English   中英

在ubuntu 11.04和python 2.7+中安裝PyQt4時出錯

[英]Error installing PyQt4 in ubuntu 11.04 and python 2.7+

>>> from PyQt4.QtCore import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PyQt4.QtCore

我一直在嘗試安裝PyQt4.QtWebKit,但是遇到了問題。 我遵循了這些指示

我能夠做Install(./ configure,make,make install)SIP很好。 我只是無法在PyQt中做到。

錯誤是:

ubuntu@ip-10-32-157-231:~/Desktop/build/PyQt$ sudo python configure.py --verbose -q     /usr/bin/qmake
Determining the layout of your Qt installation...
/usr/bin/qmake -o qtdirs.mk qtdirs.pro
make -f qtdirs.mk
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I. -o qtdirs.o qtdirs.cpp
qtdirs.cpp:1:28: fatal error: QCoreApplication: No such file or directory
compilation terminated.
make: *** [qtdirs.o] Error 1
Error: Failed to determine the layout of your Qt installation. Try again using
the --verbose flag to see more detail about the problem.
ubuntu@ip-10-32-157-231:~/Desktop/build/PyQt$

您能否建議在ubuntu natty(11.04)和python 2.7+中成功安裝PyQt4的解決方案?

您遵循的說明具有誤導性和錯誤性。

您不需要在ubuntu 11.04上構建任何東西來使用QWebKit來獲取PyQt4,因為它已經具有所有必需的軟件包。

我建議您回滾由於遵循這些說明而進行的所有更改,然后重新開始。

要獲得基本的PyQt4安裝,您只需要安裝以下軟件包:

(當然還有任何依賴項)。

“教程”簡直是胡說八道,會破壞您的系統。 可悲的是,在對zip感到沮喪並且構建無法正常工作之后,我也遵循了它(我不知道它在Ubuntu存儲庫中)。

無論如何,只需在終端中運行以下代碼:

sudo apt-get purge python-qt4 python-sip
sudo apt-get install python-qt4 python-sip

那應該解決問題。 您也可以選擇在Synaptic中執行此操作...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM