安装PyQt出现错误

10

我现在正试图运行PyQt。当我执行以下操作时仍然会出现以下错误:

root@localhost:/home/abhowmik/app/imgSeek-0.8.6# cd Py*
root@localhost:/home/abhowmik/app/imgSeek-0.8.6/PyQt-x11-gpl-4.8.4# python configure.py --verbose
Determining the layout of your Qt installation...
/usr/share/qt3//bin/qmake -o qtdirs.mk qtdirs.pro
make -f qtdirs.mk
g++ -c -pipe -g -Wall -W -O2 -D_REENTRANT  -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I/usr/include/qt3 -o qtdirs.o qtdirs.cpp
qtdirs.cpp:1:17: fatal error: QFile: 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.
root@localhost:/home/abhowmik/app/imgSeek-0.8.6/PyQt-x11-gpl-4.8.4# ^C
root@localhost:/home/abhowmik/app/imgSeek-0.8.6/PyQt-x11-gpl-4.8.4# 

有人能帮我解决这个问题吗?


1
我觉得导入并不是你在这里遇到的问题... - Ignacio Vazquez-Abrams
如果您正在尝试安装Qt,请提供有关操作系统、Python版本以及为什么要使用a、b或c方式的详细信息。 - BrainStorm
2
几乎所有系统都带有py-qt包。您可能想要安装它。 - Martin Tournoij
4个回答

10

问题在于 configure.py 尝试使用来自 Qt3 的 qmake。尝试这样做:

python configure.py --qmake /usr/bin/qmake-qt4

(你可能已经将qmake-qt4放在 /usr/bin 以外的其他位置,请先检查一下)


4

1

这是@Flyte的答案稍作修改后适用于我在CentOS 6.5上的情况

这对我有用,希望能对你也有所帮助。同时确保你安装了适当的Qt版本,通常需要使用Qt版本>4.7。

0

试试 PIP,Python 的包管理器:

pip3 install pyqt5

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接