PyQt6 Qt6 Core Components
This package provides the core Qt6 shared libraries (DLLs/SOs) compiled for Python, which are a fundamental dependency for the PyQt6 bindings. It does not contain any Python API for direct use, but rather the underlying C++ runtime components. It is typically installed automatically as a dependency of the `PyQt6` package. The current version is 6.11.0, and it generally follows the release schedule of the main PyQt6 library and the underlying Qt framework.
Warnings
- gotcha The `pyqt6-qt6` package provides the *runtime C++ libraries* of Qt6, not Python bindings or an API for direct import. Python applications should import modules directly from the `PyQt6` package (e.g., `from PyQt6.QtWidgets import QApplication`). Attempting to import from `pyqt6-qt6` will result in an `ImportError`.
- gotcha Version compatibility between `pyqt6-qt6` and `PyQt6` is crucial. Mismatched versions (e.g., `PyQt6==6.5` and `pyqt6-qt6==6.11`) can lead to runtime errors, crashes, or unexpected behavior. It is generally recommended to install `PyQt6`, which will automatically pull in a compatible `pyqt6-qt6` version.
- gotcha When deploying applications, remember that `pyqt6-qt6` bundles platform-specific binaries. If packaging your application (e.g., with PyInstaller or cx_Freeze), ensure that the target environment has the correct `pyqt6-qt6` binaries or that your packaging tool correctly includes them for the intended operating system.
- gotcha Multiple Qt installations (e.g., a system-wide Qt installation and the one provided by `pyqt6-qt6`) can lead to conflicts in environment variables (like PATH) or during runtime, causing applications to load incorrect Qt libraries.
Install
-
pip install pyqt6-qt6 -
pip install PyQt6
Quickstart
import sys
from PyQt6.QtWidgets import QApplication, QLabel, QWidget, QVBoxLayout
# Note: pyqt6-qt6 provides the underlying Qt6 C++ libraries for PyQt6 to use.
# You do not import directly from pyqt6-qt6 in your Python code.
if __name__ == '__main__':
app = QApplication(sys.argv)
window = QWidget()
window.setWindowTitle('PyQt6 with pyqt6-qt6 runtime')
layout = QVBoxLayout()
label = QLabel('Hello from PyQt6!')
layout.addWidget(label)
window.setLayout(layout)
window.show()
sys.exit(app.exec())