开发者

Error installing PyQt

开发者 https://www.devze.com 2023-03-25 17:58 出处:网络
I am now trying to run PyQt. I am still getting the following error when I do the following: root@localhost:/home/abhowmik/app/imgSeek-0.8.6# cd Py*

I am now trying to run 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. Try this:

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

(You might have qmake-qt4 somwhere else than /usr/bin so check that first )


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

Install the development headers (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

  • activate your virtualenv(optional in case you want to install in virtualenv)
  • wget http://sourceforge.net/projects/pyqt/files/sip/sip-4.15.4/sip-4.15.4.zip(your corresponding version)
  • unzip sip-4.15.4.zip
  • cd sip-4.15.4
  • python configure.py --incdir=/opt/include/python2.7(path where python is located)
  • make and make install this completes the installation of SIP one of the prerequsite -Then to install PyQt4
  • wget http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.10.3/PyQt-x11-gpl-4.10.3.tar.gz
  • tar zxvf PyQt-x11-gpl-4.10.3.tar.gz
  • cd PyQt-x11-gpl-4.10.3
  • python2.7 configure.py -k --qmake /usr/bin/qmake-qt4
  • make and finally make install

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


Try PIP, the python package manager:

pip3 install pyqt5
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号