Registry / web-framework / pyqtwebengine

pyqtwebengine

JSON →
library5.15.7pypypi✓ verified 87d ago

PyQtWebEngine is a set of Python bindings for The Qt Company's Qt WebEngine framework, providing the ability to embed web content in PyQt5 applications. It integrates the Chromium-based web engine, allowing developers to display and interact with web pages. The bindings are implemented as three separate modules sitting on top of PyQt5. The current version is 5.15.7 and it is actively maintained.

pip install PyQtWebEngine
INSTALL
IMPORT
SIG · PYQTWEBENGINE
P
pyqtwebengine
web-frameworkpythonv5.15.7
Install
5.7s avg
Import
Disk
443MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.15.7 · 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
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
installs and imports cleanly · install 5.7s · import 0.000s · 446MB
443MB installed
● package 443MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

QWebEngineView
from PyQt5.QtWebEngineWidgets import QWebEngineView
QWebEnginePage
from PyQt5.QtWebEngineWidgets import QWebEnginePage
QUrl
from PyQt5.QtCore import QUrl

This quickstart code creates a simple PyQt5 application with an embedded QWebEngineView that loads Google's homepage. It demonstrates the basic setup required to display web content within a PyQt5 window.

import sys from PyQt5.QtWidgets import QApplication, QMainWindow from PyQt5.QtWebEngineWidgets import QWebEngineView from PyQt5.QtCore import QUrl class Browser(QMainWindow): def __init__(self): super().__init__() self.browser = QWebEngineView() self.browser.setUrl(QUrl('http://www.google.com')) self.setCentralWidget(self.browser) self.showMaximized() if __name__ == '__main__': app = QApplication(sys.argv) QApplication.setApplicationName("PyQtWebEngine Browser") window = Browser() sys.exit(app.exec_())
Debug
Known issues
breakingWhen migrating from PyQt5 to PyQt6, the QtWebEngine module is no longer bundled with the main PyQt installation. For PyQt6, you must install 'pyqt6-webengine' separately (pip install pyqt6-webengine) and the import path changes from 'PyQt5.QtWebEngineWidgets' to 'PyQt6.QtWebEngineWidgets'.
fix
For PyQt6, ensure 'pyqt6-webengine' is installed and update import statements to 'from PyQt6.QtWebEngineWidgets import ...'.
affects: Transition from PyQt5 to PyQt6
gotchaInstalling only 'PyQt5' will not include the 'QtWebEngineWidgets' module. 'PyQtWebEngine' is a separate package that must be installed explicitly.
fix
Always run 'pip install PyQtWebEngine' in addition to 'pip install PyQt5' to use the web engine features.
affects: All versions
gotchaPyQtWebEngine is dual-licensed under the GNU GPL v3 and a commercial license. Unlike some other Qt modules, it is *not* available under the LGPL. This has significant implications for proprietary applications.
fix
Carefully review the license terms (GPL v3 or commercial) to ensure compliance with your application's distribution model. A commercial license may be required for proprietary software.
affects: All versions
gotchaDirect access to the Document Object Model (DOM) of a loaded web page is not provided by QWebEngineView. Interactions with the web content (e.g., executing JavaScript, getting values) are primarily achieved through `QWebEnginePage.runJavaScript()`.
fix
Utilize `QWebEnginePage.runJavaScript()` to inject and execute JavaScript code for interacting with the web page's DOM and fetching results.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'PyQt5.QtWebEngineWidgets'
The PyQtWebEngine package, which provides the QtWebEngineWidgets module, is not installed or is not accessible in the current Python environment.
fix
Install the PyQtWebEngine package using pip: `pip install PyQtWebEngine`
ERROR: Could not find a version that satisfies the requirement PyQtWebEngine
The version of Python or pip is incompatible with available PyQtWebEngine wheels, or pip itself is outdated and cannot find suitable distributions.
fix
Upgrade pip using `python -m pip install --upgrade pip` and then try `pip install PyQtWebEngine` again, ensuring your Python version is supported by the latest PyQtWebEngine releases.
AttributeError: 'PyQt5.QtWebEngineWidgets.QWebEngineView' object has no attribute 'url'
The `url` property of `QWebEngineView` is accessed as a direct attribute, but it is a method that must be called to retrieve the current URL.
fix
Call the `url()` method to get the current URL: `current_url = view.url()`
The procedure entry point ... could not be located in the dynamic link library QtWebEngineCore.dll
This error typically indicates a version mismatch between PyQtWebEngine components or missing/corrupted `QtWebEngineCore.dll` and its dependencies, often occurring during deployment or after an incomplete update on Windows.
fix
Ensure PyQtWebEngine is properly installed in your environment (`pip install --force-reinstall PyQtWebEngine`) or, for deployed applications, ensure all necessary Qt and QtWebEngine DLLs are correctly bundled and accessible to the application executable.
Upgrade
Version history
5.15.7latest on PyPI · released Jul 19, 2024
Audit
Dependencies
PyQt5requiredPyQtWebEngine provides bindings for the Qt WebEngine framework, which sits on top of and requires PyQt5 to function.
Agent activity
15 hits · last 30 days
node
12
Resources
pyqtwebengine — pip install pyqtwebengine · libregistry