-
Notifications
You must be signed in to change notification settings - Fork 79
Installation
You have two options for getting PyQt5 installed on your system.
- Install from PyPI
- Clone from GitHub
To install via PyPI, simply run pip
.
$ pip install python-qt5
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.
-
In your Python directory - e.g.
c:\Python27
-
Create a
qt.conf
-
With this.
[Paths]
Prefix = c:/github/python-qt5/PyQt5
Binaries = c:/github/python-qt5/PyQt5
-
Make sure to only use forward slashes (/) and no back slashes (\).
-
Where each path must point to the
PyQt5
subdirectory of where you cloned. -
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()
>>> app.exec_()
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