Wie installiere ich PyQt unter Ubuntu 12.04 mit Python 2.7?

Möglicherweise gibt es einige ähnliche Fragen wiedieses, aber ich habe keine Antwort für mich gefunden.

Ich habe versucht, es wie folgt zu machen:

sudo aptitude install python-qt4-dev python-sip4 python-sip4-dev

von:https://groups.google.com/forum/#!topic/mnemosyne-proj-devel/VQQzjhARWoA

Ich habe es versucht:

sudo aptitude install python-qt4

von:http://www.saltycrane.com/blog/2008/01/how-to-install-pyqt4-on-ubuntu-linux/

Jedes Mal, wenn nach den obigen Installationen ein Fehler aufgetreten ist:

$python2.7
Python 2.7.3 (default, Aug  1 2012, 05:14:39) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt4
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named PyQt4

Ich habe auch versucht, es von der Quelle zu installieren, von der PyQt4 heruntergeladen wurde:http://www.riverbankcomputing.co.uk/software/pyqt/download und schluck aus:http://www.riverbankcomputing.co.uk/software/sip/download

Dann habe ich eine Fehlermeldung bekommen, um PyQt4 zu installieren:

$ sudo python configure.py --verbose
Determining the layout of your Qt installation...
/usr/bin/qmake -o qtdirs.mk qtdirs.pro
make -f qtdirs.mk
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++-64 -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.

Meine Frage ist: Wie installiere ich PyQt4 auf Ubuntu 12.04 richtig und effektiv?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage