QtPy
Provides an abstraction layer on top of the various Qt bindings (PyQt5/6 and PySide2/6).
Decision gist · record as of 2026-08-14
Yes, if you are building or maintaining a Qt application and want flexibility in which binding you use or plan to migrate between bindings. The low install friction and active maintenance make it a safe dependency. Not necessary if you are locked into a single binding and have no plans to switch.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires PyQt5, PySide2, PyQt6, or PySide6 to be installed separately; QtPy is only the abstraction layer.
- Low friction install with a single runtime dependency (packaging).
- Active maintenance with recent releases and a stable codebase.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use QtPy in commercial and proprietary projects with minimal restrictions.
last release 2025-02-11 (549 days) · last repo commit 2026-04-12 · 1,101 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,422,359 downloads/mo, #2,309 on PyPI
Alternatives
Verify before relying
pip install qtpy
import qtpy
# Select binding via QT_API environment variable (pyqt5, pyside2, pyqt6, pyside6)
# QtPy routes calls to the selected binding transparently- Whether the package handles all edge cases between Qt5 and Qt6 enum differences automatically.
- Performance overhead of the abstraction layer compared to direct binding use.
- Completeness of compatibility wrappers for less common Qt modules and classes.
What it is and what it does
QtPy is a thin abstraction layer that lets you write Qt applications using a single, unified API that works with any of the four major Qt Python bindings: PyQt5, PySide2, PyQt6, or PySide6. Instead of importing directly from a specific binding, you import from qtpy, and the library transparently routes your calls to whichever binding is installed and selected via the QT_API environment variable (defaulting to PyQt5 if multiple are present).
The main value is in reducing friction when porting code between bindings or upgrading Qt versions. When you need to switch from PyQt5 to PyQt6, or migrate from PyQt to PySide, you can do so module by module without rewriting your entire codebase. QtPy handles known incompatibilities—such as exposing PyQt's pyqtSignal, pyqtSlot, and pyqtProperty as Signal, Slot, and Property, and handling PyQt6's unscoped enums—so your code stays portable across all four bindings.
Use it for
- Develop a desktop application that can run on either PyQt5 or PySide6 without code duplication.
- Gradually migrate an existing PyQt5 codebase to PyQt6 by updating imports to use QtPy first.
- Support multiple Qt bindings in a library so users can choose their preferred binding.
- Write tests that run against multiple Qt bindings to ensure compatibility.
- Simplify CI/CD by testing a single codebase against PyQt5, PySide2, PyQt6, and PySide6.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building or maintaining a Qt application and want flexibility in which binding you use or plan to migrate between bindings.
The low install friction and active maintenance make it a safe dependency. Not necessary if you are locked into a single binding and have no plans to switch.
Install
qtpy on PyPI
Before you install
Low friction install with a single runtime dependency (packaging). Active maintenance with recent releases and a stable codebase.
Requires PyQt5, PySide2, PyQt6, or PySide6 to be installed separately; QtPy is only the abstraction layer.
License in practice
MIT license is permissive; you can use QtPy in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install qtpy
import qtpy
# Select binding via QT_API environment variable (pyqt5, pyside2, pyqt6, pyside6)
# QtPy routes calls to the selected binding transparently
Verify before relying
- Whether the package handles all edge cases between Qt5 and Qt6 enum differences automatically.
- Performance overhead of the abstraction layer compared to direct binding use.
- Completeness of compatibility wrappers for less common Qt modules and classes.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepackaging |
| Maintenance | Actively maintained 549 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,422,359 / month, #2,309 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: MacOS XEnvironment :: Win32 (MS Windows)Environment :: X11 Applications :: QtIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: User InterfacesTopic :: Software Development :: Widget Sets |
Evidence: QtPy-2.4.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “qt abstraction layer”
- QtPyQtPy provides a unified API for writing Qt applications that work…
- pyvistaqtPyVistaQt integrates VTK 3D visualization with Qt GUI frameworks,…
- PySide6PySide6 provides Python bindings to the Qt 6.0+ framework, enabling…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also PySide6 · spyder · qasync · PySide2 · pytest-qt · PyQt5 · qtmonaco · QDarkStyle · PyQt6 · QtAwesome