Noticed that pip install pyqt isn't working? At least at the time of writing this blog it isn't..

This is the error that I got:
IOError: [Errno 2] No such file or directory:

It seems they didn't package it well and it's using to install. So here is the solution to install it by using pip to download the files and configure and install manually.

Solution copied from:

workon myProject  
pip install --no-install SIP  
pip install --no-install PyQt  
cd ~/.virtualenvs/myProject/build/SIP  
make install  
cd ~/.virtualenvs/myProject/build/PyQt  
make install  
cd && rm -rf ~/.virtualenvs/myProject/build # Optional.

Issues I encountered:

  • Missing development headers for qt:
    ~/.virtualenvs/scrapy/build/PyQt# python --verbose  
    Determining the layout of your Qt installation...  
    /usr/bin/qmake -o  
    make -f 
    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/includ e/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.

Soltution: Install the development headers (Ubuntu 12.04)

sudo apt-get install libqt4-dev


comments powered by Disqus