Sometimes you need to know which version of PyQt6 you have installed. Below are two ways to check your PyQt6 version number — first using the pip command on the command line and second, programmatically from within your Python code using PyQt6 itself.
Check the PyQt6 Version From the Command Line
If you just want to quickly check which version of PyQt6 is installed, and you installed the package using pip, you can use the pip show command to return the current version:
$ pip show pyqt6
Name: PyQt6
Version: 6.9.0
Summary: Python bindings for the Qt cross platform application toolkit
Home-page: https://www.riverbankcomputing.com/software/pyqt/
Author:
Author-email: Riverbank Computing Limited <info@riverbankcomputing.com>
License: GPL v3
Location: .../lib/python3.13/site-packages
Requires: PyQt6-Qt6, PyQt6-sip
Required-by:
The second line of this output shows the PyQt6 version number installed in your current Python environment. In this particular example, we're using PyQt6 version 6.9.0. If you haven't installed PyQt6 yet, see our guide to installing PyQt6 on Windows.
Get the PyQt6 Version Number Within Your Python Code
Sometimes, you need to check the PyQt6 version programmatically within your code. For example, if you're a library developer and your code uses certain features of PyQt6 that are only available in specific versions, you may want to disable these features in earlier versions.
In that case, you can import QT_VERSION_STR and PYQT_VERSION_STR from PyQt6.QtCore to get both the Qt and PyQt6 version numbers:
>>> from PyQt6.QtCore import QT_VERSION_STR, PYQT_VERSION_STR
>>> print(
"Qt: v", QT_VERSION_STR,
"\tPyQt6: v", PYQT_VERSION_STR
)
Qt: v 6.9.0 PyQt6: v 6.9.0
This also gives you the underlying Qt version. On my machine, I'm running version 6.9.0 of both Qt and PyQt6.
Summary
Checking your PyQt6 version is straightforward using either of these two methods. Use pip show pyqt6 for a quick command-line check, or import QT_VERSION_STR and PYQT_VERSION_STR from PyQt6.QtCore when you need to determine the version programmatically at runtime. Knowing the exact PyQt6 and Qt versions helps you troubleshoot compatibility issues and ensure your Python GUI applications work as expected. If you're wondering how PyQt6 compares to PySide6, check out our PyQt6 vs PySide6 comparison.
Create GUI Applications with Python & Qt6 by Martin Fitzpatrick
(PyQt6 Edition) The hands-on guide to making apps with Python — Over 15,000 copies sold!