31

I'm trying to install PyQt package with pip, but I get this error:

~$ pip install PyQt

Downloading/unpacking PyQt  
Downloading PyQt-x11-gpl-4.8.3.tar.gz
(9.8Mb): 9.8Mb downloaded   Running
setup.py egg_info for package PyQt
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
    IOError: [Errno 2] No such file or directory:
'/home/john/build/PyQt/setup.py'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in
<module>

IOError: [Errno 2] No such file or
directory:
'/home/john/build/PyQt/setup.py

---------------------------------------- Command python setup.py egg_info
failed with error code 1 Storing
complete log in
/home/john/.pip/pip.log
E.Z.
  • 6,393
  • 11
  • 42
  • 69
J91321
  • 437
  • 1
  • 5
  • 9

6 Answers6

15

That's because that file has a configure.py not a setup.py. configure.py generate a make file that you use to build pyqt against the qt lib you choose by passing --qmake option to configure.py, it has different options too. I suggest filing a bug with the pip maintainer.

Mike Ramirez
  • 10,750
  • 3
  • 26
  • 20
9

If you're on Mac, you can use homebrew:

brew install pyqt
Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Andy Li
  • 5,894
  • 6
  • 37
  • 47
5

You can, alternatively, install PyQt4 using ActivePython's binary package manager.

$ pypm install pyqt4
The following packages will be installed into "~/.local" (2.7):
 pyqt4-4.8.3.0
Hit: [pypm-free.activestate.com] pyqt4 4.8.3.0
Installing pyqt4-4.8.3.0
$

So long as you already have PyPM, no compilation required.

isomorphismes
  • 8,233
  • 9
  • 59
  • 70
Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
2

Sharing my setup procedure:

  1. create virtual environment on your project folder and activate:

    python3 -m venv venv source venv/bin/activate

  2. use pip to install PyQt5 (Note: specify the version especially on Centos7)

    pip3 install pyqt5==5.14

code pinguin
  • 94
  • 1
  • 9
1

you can pip install the directory of the downloaded version of pyqt after you download it ..google for your desired version

Ahmed Wagdi
  • 3,913
  • 10
  • 50
  • 116
0

I had the same issue on my raspberry-pi 3 model B (rasberry pi os) and I resolved it using apt-get

Here:

pip3 install --user pyqt5

sudo apt-get install python3-pyqt5

Optionally:

sudo apt-get install pyqt5-dev-tools

sudo apt-get install qttools5-dev-tools