PyQt6-sip
PyQt6-sip provides the runtime 'sip' extension module necessary for the PyQt6 framework. SIP is a crucial tool developed by Riverbank Computing Limited for automatically generating Python bindings for C and C++ libraries, originally created for PyQt. The pyqt6-sip package specifically contains the compiled 'sip' module that PyQt6 uses internally. It is actively maintained with frequent releases, often synchronized with PyQt6 and new Python version support. The current version is 13.11.1.
Warnings
- gotcha ModuleNotFoundError: No module named 'PyQt6.sip' errors are common. This often indicates an issue with the Python environment, virtual environment configuration, or incorrect installation paths where pyqt6-sip might be installed separately from other PyQt6 components.
- breaking PyQt6 6.7.1, when used with Python 3.13.0 (as of October 2024), experienced `ModuleNotFoundError: No module named 'PyQt6.sip'` errors. This points to potential compatibility issues with specific Python preview versions.
- gotcha The `pyqt6-sip` package has a `Requires-Python` metadata that varies across its releases (e.g., >=3.7 for 13.5.0, >=3.8 for 13.8.0, >=3.10 for 13.11.1). Installing an incompatible version with your Python interpreter will lead to failures.
- breaking Version 13.9.0 of `pyqt6-sip` was yanked from PyPI due to an 'Incorrect Requires-Python' dependency specification, indicating a critical metadata error that could lead to installation issues or runtime problems.
Install
-
pip install pyqt6-sip
Imports
- sip
from PyQt6 import sip
Quickstart
from PyQt6 import sip
# Accessing a sip attribute to demonstrate the module is loaded
print(f"PyQt6.sip version string: {sip.SIP_VERSION_STR}")
print(f"PyQt6.sip API version: {sip.api_version}")