可能有一些类似的问题,但我没有找到任何适合我的答案。
我尝试了一些方法来做到这一点:
sudo aptitude install python-qt4-dev python-sip4 python-sip4-dev
来自:https ://groups.google.com/forum/#!topic/mnemosyne-proj-devel/VQQzjhARWoA
我试过了:
sudo aptitude install python-qt4
来自: http: //www.saltycrane.com/blog/2008/01/how-to-install-pyqt4-on-ubuntu-linux/
每次上述安装后,我都会收到错误:
$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
我还尝试从下载 PyQt4 的源代码安装它: http ://www.riverbankcomputing.co.uk/software/pyqt/download 和 sip 从:http ://www.riverbankcomputing.co.uk/software/sip/download
然后我得到了安装 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.
我的问题是:在 Ubuntu 12.04 上安装 PyQt4 的正确有效方法是什么?