Python 2.7 cannot import PyQt4

前端 未结 6 1381
無奈伤痛
無奈伤痛 2021-01-04 10:34

I\'ve upgraded to Python 2.7 from Python 2.6 on Ubuntu Maverick Meerkat (10.10) and I\'m unable to import PyQt4.

austin@gerald:~$ python2.7
Python 2.7.0+ (r2         


        
6条回答
  •  逝去的感伤
    2021-01-04 10:42

    OSX 10.8.2 tested:

    sudo pip install SIP
    

    got IOError: [Errno 2] No such file or directory: '/tmp/pip-build/SIP/setup.py'

    It's ok then:

    cd /tmp/pip-build/SIP
    sudo python configure.py
    make
    sudo make install
    

    download PyQt from: http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.9.6/PyQt-mac-gpl-4.9.6.tar.gz

    unzip it.

    cd PyQt-mac-gpl-4.9.6
    sudo python configure.py
    make
    

    it will take a while, after make then:

    sudo make install    
    

    Enjoy it :)

提交回复
热议问题