Install & Compatibility
Where this runs
tested against v6.11.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 8.0s · import 0.000s · 669MB
662MB installed
● package 662MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
QApplication
✓ from PySide6.QtWidgets import QApplication
QMainWindow
✓ from PySide6.QtWidgets import QMainWindow
QWidget
✓ from PySide6.QtWidgets import QWidget
QLabel
✓ from PySide6.QtWidgets import QLabel
QPushButton
✓ from PySide6.QtWidgets import QPushButton
QVBoxLayout
✓ from PySide6.QtWidgets import QVBoxLayout
QAction
✓ from PySide6.QtGui import QAction
✗ from PySide6.QtWidgets import QAction
QAction was moved from QtWidgets to QtGui in Qt6/PySide6.
Qt (for enums like alignment)
✓ from PySide6.QtCore import Qt
This quickstart code creates a basic PySide6 application with a main window, a label displaying 'Hello, PySide6!', and a button. Clicking the button changes the label's text and prints a message to the console. It demonstrates fundamental concepts like QApplication, QMainWindow, widgets, layouts, and signal/slot connections.
import sys
from PySide6.QtWidgets import QApplication, QMainWindow, QLabel, QVBoxLayout, QWidget, QPushButton
from PySide6.QtCore import Qt
class MyWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle('PySide6 Hello World!')
self.setGeometry(100, 100, 400, 200)
layout = QVBoxLayout()
label = QLabel('Hello, PySide6!')
label.setAlignment(Qt.AlignCenter)
layout.addWidget(label)
button = QPushButton('Click Me!')
button.clicked.connect(self.on_button_click)
layout.addWidget(button)
container = QWidget()
container.setLayout(layout)
self.setCentralWidget(container)
def on_button_click(self):
print('Button clicked!')
self.centralWidget().findChild(QLabel).setText('You clicked the button!')
if __name__ == '__main__':
app = QApplication(sys.argv)
window = MyWindow()
window.show()
sys.exit(app.exec())
Debug
Known issues
breakingWhen migrating from PySide2 to PySide6, the primary change required is updating import statements from `PySide2.*` to `PySide6.*`.fixReplace `from PySide2` with `from PySide6` in all import statements.
affects: All versions when migrating from PySide2
breakingThe `QAction` class, used for creating toolbars and menus, has been moved from `PySide6.QtWidgets` to `PySide6.QtGui` in Qt6.fixUpdate imports for `QAction` to `from PySide6.QtGui import QAction`.
affects: All PySide6 versions (vs. PySide2)
breakingHigh DPI (dots per inch) scaling is enabled by default in Qt6. The previously used attributes like `Qt.AA_EnableHighDpiScaling` and `Qt.AA_UseHighDpiPixmaps` are deprecated and have no effect.fixRemove any explicit High DPI scaling attributes from your application initialization code.
affects: All PySide6 versions (vs. PySide2)
gotcha`QMouseEvent.pos()` and `QMouseEvent.globalPos()` now return a `QPointF` object (floating-point coordinates), unlike in Qt5 where they returned integer tuples.fixIf integer coordinates are strictly required, convert the `QPointF` to `QPoint` using `.toPoint()`, e.g., `event.pos().toPoint()`.
affects: All PySide6 versions (vs. PySide2)
gotchaFunctions named `exec_()` (e.g., `QApplication.exec_()`, `QDialog.exec_()`) have been renamed to `exec()` in PySide6 to avoid conflict with the `exec` keyword in Python 3.fixReplace calls to `exec_()` with `exec()`.
affects: All PySide6 versions (vs. PySide2)
gotchaQt Enums no longer necessarily inherit to the top-level `Qt` object. For example, `Qt.AlignCenter` might not be directly accessible and requires explicit import or a more specific path.fixFor enums, use their full path (e.g., `QtCore.Qt.AlignmentFlag.AlignCenter`) or import the specific enum class if available.
affects: All PySide6 versions (vs. PySide2)
gotchaPySide6 offers an experimental `snake_case` feature (via `from __feature__ import snake_case`) to align method naming with PEP8. However, this is an opt-in feature and can lead to inconsistent code if not applied uniformly across a project, especially with auto-generated UI code.fixDecide on a consistent naming convention. If using `snake_case`, ensure all new code and potentially existing code (or auto-generated UI code) adheres to it to avoid mixed styles.
affects: All PySide6 versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'PySide6.QtWebEngineWidgets'
The PySide6.QtWebEngineWidgets module, which provides web engine capabilities, is not part of the base pyside6 package and requires a separate installation.
fixpip install pyside6-webengine
AttributeError: 'PySide6.QtWidgets.QApplication' object has no attribute 'exec_'
In PySide6 (and Qt6), the `exec_()` method for `QApplication` was renamed to `exec()` to remove the Python 2 compatibility underscore.
fixChange `app.exec_()` to `app.exec()`.
pyside6-designer: command not found
The `pyside6-designer` tool (along with `pyside6-uic` and `pyside6-rcc`) is not included in the base `pyside6` package and needs to be installed separately.
fixpip install pyside6-tools
ImportError: DLL load failed while importing QtWidgets: The specified module could not be found.
On Windows, this often indicates missing runtime dependencies, particularly the Microsoft Visual C++ Redistributable, or issues with environment variables preventing DLLs from being found.
fixInstall the latest Microsoft Visual C++ Redistributable for your system architecture. Ensure your Python environment and PATH are correctly configured.
Upgrade
Version history
6.11.2latest on PyPI · released Aug 18, 2026
Audit
Dependencies
shiboken6requiredShiboken6 is the binding generator tool used by PySide6 to expose C++ projects to Python, and is a core component of the Qt for Python project, often installed alongside PySide6.