简体   繁体   English

安装 PyQt 时出错

[英]Error installing PyQt

I am now trying to run PyQt.我现在正在尝试运行 PyQt。 I am still getting the following error when I do the following:当我执行以下操作时,我仍然收到以下错误:

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# 

Can someone help me how to fix the problem?有人可以帮我解决问题吗?

Problem is that configure.py is trying to use qmake from qt3.问题是 configure.py 试图使用 qt3 中的 qmake。 Try this:试试这个:

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

(You might have qmake-qt4 somwhere else than /usr/bin so check that first ) (您可能在 /usr/bin 以外的其他地方安装了 qmake-qt4,因此请先检查一下)

Try this, http://samos-it.com/install-pyqt-in-a-virtualenv-with-pip/试试这个, http://samos-it.com/install-pyqt-in-a-virtualenv-with-pip/

Install the development headers (Ubuntu 12.04):安装开发头文件(Ubuntu 12.04):

sudo apt-get install libqt4-dev

Then try again然后再试一次

This is a slightly modified answer of @Flyte which worked for me on CentOS 6.5这是@Flyte 稍加修改的答案,它在 CentOS 6.5 上对我有用

this worked for me hope it helps you also.这对我有用,希望它也能帮助你。 also make sure you have proper version of qt installed usually need to use qt version>4.7还要确保您安装了正确版本的qt 通常需要使用qt version>4.7

试试 PIP,python 包管理器:

pip3 install pyqt5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM