How to install PyQt on Ubuntu 12.04 with python 2.7?

倖福魔咒の 提交于 2019-12-03 02:32:26

You did in fact properly install the python bindings for Qt4 when you used:

sudo aptitude install python-qt4

You should usually use the Distribution-provided packages - the Ubuntu-provided packages are perfectly adequate for your needs.

What's puzzling me is the error you got after installing the Ubuntu package. I just tried this on a Ubuntu 12.04 installation and it worked for me. That suggests to me that your current installation of Ubuntu on your system is broken in some way.

You could try completely purging the python-qt4 package and reinstalling it again;

sudo apt-get remove --purge python-qt4

If you also issue:

sudo apt-get clean

... that will remove any downloaded package files from the system, so that apt will then download the package file again when you issue a

sudo apt-get install python-qt4

If that still doesn't work, then something very odd indeed is going on with your Ubuntu installation, and it might be wise to completely reinstall Ubuntu.

On aws ubuntu (12.04 and 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

Check this link and generate your-own-example.py

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

Voila.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!