Skip to content
Marcus Ottosson edited this page Feb 22, 2015 · 14 revisions

You have two options for getting PyQt5 installed on your system.

  1. Install from PyPI
  2. Clone from GitHub



PyPI installation

To install via PyPI, simply run pip.

$ pip install python-qt5



Clone from GitHub

Alternatively, you may choose to clone from GitHub.

$ cd c:\github
$ git clone https://github.com/pyqt/python-qt5.git

Initializing Python

Pip automatically creates a qt.conf file in your Python directory, Qt needs this in order to run successfully. We'll need to create it by hand.

  1. In your Python directory - e.g. c:\Python27

  2. Create a qt.conf

  3. With this.

[Paths]
Prefix = c:/github/python-qt5/PyQt5
Binaries = c:/github/python-qt5/PyQt5
  1. Make sure to only use forward slashes (/) and no back slashes (\).

  2. Where each path must point to the PyQt5 subdirectory of where you cloned.

  3. Now you can append the repository to your PYTHONPATH

$ set PYTHONPATH=c:\github\python-qt5
$ python
>>> import sys
>>> from PyQt5 import QtWidgets
>>> app = QtWidgets.QApplication(sys.argv)
>>> button = QtWidgets.QPushButton("Hello")
>>> button.setFixedSize(400, 400)
>>> button.show()

Python Qt5 is fully encapsulated and requires no further tweaking. If this isn't true for you, that is a bug and you may submit an issue or pull-request with a fix.

Welcome to the wiki for PyQt5 using Python 2.7. For Python 3.4, head here

Table of contents

Developer Resources

Compilation Instructions

Clone this wiki locally