How to install PyQt5 on Windows? How to install PyQt5 on Windows? python python

How to install PyQt5 on Windows?


Mainly I use the following command under the cmd

pip install pyqt5

And it works with no problem!


The easiest way to install PyQt is to just use the installer (Link in your answer, step #5). If you install python 3.3, the installer will add all of the PyQt5 extras to that python installation automatically. You won't need to do any compiling (none of: nmake, nmake install, python configure).

All of the build options are available for if you need a custom install (for instance, using a different version of python, where there isn't an installer provided by riverbank computing).

If you do need to compile your own version of PyQt5, the steps (as you have found) are here, but assume you have python and a compiler installed and in your path. The installed and in your path have been where you have been running into trouble it seems. I'd recommend using the installer version, but you need to install python 3.3 first.


First try this in your Windows cmd window:

pip3 install pyqt5

If that is successful, it will look something like this:

C:\Windows\System32>pip3 install pyqt5Collecting pyqt5  Downloading PyQt5-5.9-5.9.1-cp35.cp36.cp37-none-win_amd64.whl (77.2MB)    100% |################################| 77.2MB 13kB/sCollecting sip<4.20,>=4.19.3 (from pyqt5)  Downloading sip-4.19.3-cp35-none-win_amd64.whl (49kB)    100% |################################| 51kB 984kB/sInstalling collected packages: sip, pyqt5Successfully installed pyqt5-5.9 sip-4.19.3

If that did not work, you might try this link from SourceForge.

PyQt5 .exe installers for Windows

How to find the installer that's right for you?

First, determine what version of Python you have and whether you have 32-bit or 64-bit Python.Next, open one of the directories. I'm on Python 3.5 64-bit so I'm looking for a .exe with those specs. When you open a directory on SourceForge, you will see some directories with ONLY .zip or .tar.gz. That's not what you're looking for. A good indication of which directory you should click is given by the "Downloads/Week" column.I'll open the PyQt-5.6 directory in my case.

Here we notice some .exe files:

PyQt-5.6|_PyQt5-5.6-gpl-Py3.5-Qt5.6.0-x32-2.exe|_PyQt5-5.6-gpl-Py3.5-Qt5.6.0-x64-2.exe|_PyQt5_gpl-5.6.zip|_PyQt5_gpl-5.6.tar.gz

I know these are Python 3.5 by Py3.5 in the file name. I am also looking for the 64-bit version so I'll download PyQt5-5.6-gpl-Py3.5-Qt5.6.0-x64-2.exe. Final answer!

Note: if you try to install a version that's not compatible with your system, a dialog box will appear immediately after running the .exe. That's an indication that you've chosen the wrong one. I'm not trying to sound like a dbag... I did that several times!

To test a successful install, in your Python interpreter, try to import:

from PyQt5 import QtCore, QtGui, QtWidgets