Install & Compatibility
Where this runs
tested against v5.15.2.1 · 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 1.6s · import 0.000s · 21MB
19MB installed
● package 19MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Shiboken
✓ from shiboken2 import Shiboken
✗ import shiboken
The module is named 'shiboken2' on PyPI, but the import package is 'shiboken2'. Use the correct import to avoid ModuleNotFoundError.
getCppPointer
✓ from shiboken2 import getCppPointer
✗ from PySide2 import getCppPointer
Shiboken functions are not part of PySide2's public API; import explicitly from shiboken2.
Basic usage: import the Shiboken helper and get the C++ pointer of a Qt object.
from shiboken2 import Shiboken
from PySide2.QtWidgets import QWidget
widget = QWidget()
print(Shiboken.getCppPointer(widget))
shiboken2 --version
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'shiboken2'
shiboken2 is not installed or PySide2 is missing.
fixInstall PySide2: pip install PySide2
ImportError: cannot import name 'getCppPointer' from 'PySide2'
Trying to import shiboken functions from the wrong package.
fixUse: from shiboken2 import getCppPointer
RuntimeError: shiboken2. Shiboken needs to be imported after PySide2
shiboken2 module imported before PySide2 initialises Qt.
fixAlways import shiboken2 after PySide2 (or any Qt module) has been imported in your application.
Upgrade
Version history
5.15.2.1latest on PyPI · released Jan 14, 2022
Audit
Dependencies
PySide2requiredShiboken2 is the runtime dependency for PySide2; they must be version-matched.