python-2.7 installation pyqt4 ubuntu-12.04

¿Cómo instalar PyQt en Ubuntu 12.04 con python 2.7?



python-2.7 installation (2)

De hecho, instaló correctamente los enlaces de python para Qt4 cuando usó:

sudo aptitude install python-qt4

Por lo general, debe usar los paquetes provistos por la Distribución; los paquetes provistos por Ubuntu son perfectamente adecuados para sus necesidades.

Lo que me desconcierta es el error que recibió después de instalar el paquete de Ubuntu. Acabo de intentar esto en una instalación de Ubuntu 12.04 y funcionó para mí. Eso me sugiere que su instalación actual de Ubuntu en su sistema está rota de alguna manera.

Puede intentar purgar completamente el paquete python-qt4 y volver a instalarlo;

sudo apt-get remove --purge python-qt4

Si usted también emite:

sudo apt-get clean

... eso eliminará cualquier archivo de paquete descargado del sistema, para que apt luego vuelva a descargar el paquete cuando emita un

sudo apt-get install python-qt4

Si eso todavía no funciona, entonces algo muy extraño está sucediendo con su instalación de Ubuntu, y podría ser conveniente reinstalar completamente Ubuntu.

Puede haber algunas preguntas similares como esta , pero no encontré ninguna respuesta para mí.

Probé algunas maneras de hacerlo como:

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

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

Lo intenté:

sudo aptitude install python-qt4

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

Cada vez después de las instalaciones anteriores tengo error:

$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

También intenté instalarlo desde la fuente descargando PyQt4 desde: http://www.riverbankcomputing.co.uk/software/pyqt/download y sip desde: http://www.riverbankcomputing.co.uk/software/sip/download

Luego obtuve un error al instalar PyQt4:

$ 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.

Mi pregunta es: ¿Cuál es la forma correcta y efectiva de instalar PyQt4 en Ubuntu 12.04?


En aws ubuntu (12.04 y 14.04):

sudo apt-get update sudo apt-get install python-qt4 sudo apt-get install libxml2-dev libxslt1-dev python-dev sudo apt-get install python-lxml sudo apt-get install xvfb

Revise este enlace y genere su propio ejemplo.

DISPLAY=localhost:1.0 xvfb-run python your-own-example.py

Voila