How to install PyQt on Ubuntu 12.04 with python 2.7?

前端 未结 2 1575
独厮守ぢ
独厮守ぢ 2021-02-05 06:38

There may be some similar questions like this one, but I didn\'t find any answer for me.

I tried some ways to do it like:

sudo aptitude install python-qt4-

相关标签:
2条回答
  • 2021-02-05 07:11

    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.

    0 讨论(0)
  • 2021-02-05 07:22

    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.

    0 讨论(0)
提交回复
热议问题