{"id":2706,"library":"pyqt5-sip","title":"PyQt5 SIP Module Support","description":"The `pyqt5-sip` package provides the SIP module, which is essential support for PyQt5. SIP is a powerful tool for creating Python bindings for C and C++ libraries, originally developed for the Qt toolkit. The current version is 12.18.0, with ongoing maintenance releases to ensure compatibility and provide bug fixes.","status":"active","version":"12.18.0","language":"en","source_language":"en","source_url":"https://github.com/Python-SIP/sip","tags":["PyQt5","SIP","bindings","C++","GUI","Qt"],"install":[{"cmd":"pip install PyQt5-sip","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Provides the Python bindings for Qt, which pyqt5-sip supports.","package":"PyQt5","optional":false},{"reason":"Runtime environment. Requires Python >= 3.10.","package":"python","optional":false},{"reason":"The core SIP binding generator and runtime module; pyqt5-sip is the PyQt5-specific distribution of this module.","package":"sip","optional":false}],"imports":[{"note":"After PyQt 5.14.0, the sip module is no longer directly exposed under 'PyQt5'. Ensure the 'pyqt5-sip' package is installed and import 'sip' directly if needed for advanced binding generation or configuration. For most PyQt5 application users, its presence is implicit.","wrong":"from PyQt5 import sip","symbol":"sip","correct":"import sip"}],"quickstart":{"code":"import sys\nfrom PyQt5.QtWidgets import QApplication, QLabel, QWidget\nfrom PyQt5.QtCore import Qt\n\n# This simple PyQt5 app implicitly relies on pyqt5-sip\n# for its underlying C++/Python bindings.\n\ndef main():\n    app = QApplication(sys.argv)\n\n    window = QWidget()\n    window.setWindowTitle(\"PyQt5 SIP Check\")\n    window.setGeometry(100, 100, 300, 200)\n\n    label = QLabel(\"Hello, PyQt5 with SIP!\", window)\n    label.setAlignment(Qt.AlignCenter)\n    label.setGeometry(0, 0, 300, 200)\n\n    window.show()\n    sys.exit(app.exec_())\n\nif __name__ == \"__main__\":\n    main()","lang":"python","description":"The `pyqt5-sip` package provides the underlying support for PyQt5. A typical PyQt5 application implicitly uses `sip` for its C++/Python bindings. This quickstart demonstrates a basic PyQt5 window, confirming that `pyqt5-sip` is correctly installed and supporting your PyQt5 environment."},"warnings":[{"fix":"Ensure `PyQt5-sip` is explicitly installed via `pip install PyQt5-sip`. If direct access to the `sip` module is required, import it as `import sip` instead of `from PyQt5 import sip`.","message":"When upgrading PyQt5 to version 5.14.0 or later, applications might encounter `ModuleNotFoundError: No module named 'PyQt5.sip'`. This is due to changes in how the `sip` module is packaged and located within the library.","severity":"breaking","affected_versions":"PyQt5 >= 5.14.0"},{"fix":"Install the 'Microsoft C++ Build Tools' which includes the necessary compiler.","message":"Building `pyqt5-sip` or PyQt5 from source on Windows requires a compatible C++ compiler, specifically Microsoft Visual C++ 14.0 or greater (often obtained via 'Microsoft C++ Build Tools').","severity":"gotcha","affected_versions":"All versions when building from source on Windows"},{"fix":"Ensure your Python environment is version 3.10 or later.","message":"Newer versions of SIP (and consequently `pyqt5-sip`) have increased their minimum Python version requirement. `pyqt5-sip` 12.18.0 requires Python >= 3.10.","severity":"gotcha","affected_versions":"SIP >= 6.9.0, pyqt5-sip >= 12.18.0"},{"fix":"Migrate binding generation projects to use `sip-build` and `PyQt-builder` for a more robust and up-to-date build process.","message":"The `sipconfig` module, previously used for configuring SIP bindings, is considered outdated. For developers creating C++ bindings, the modern approach involves `sip-build` and `PyQt-builder`.","severity":"deprecated","affected_versions":"All versions using older binding generation workflows"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}