Inject itself into sys.modules for other PyQt versions
See original GitHub issueScenario:
In my app, I from qtpy.QtCore import Qt
. I run my app with QT_API=pyqt5
, so PyQt5 is preferred, defaulting to PyQt4 if the former is not available. Anyway, PyQt5 is available and my app runs fine.
In some obscure module, or in a stand-alone add-on for my app, I rely on a third-party Python package that imports and works with PyQt4. The import fails. My app breaks.
Use case:
I would like like qtpy to inject itself into sys.modules
so that any requests for objects from PyQt4 are resolved, best effort, from qtpy.
Issue Analytics
- State:
- Created 7 years ago
- Comments:21 (13 by maintainers)
Top Results From Across the Web
PyQt modules can't be imported after QtWidgets.QApplication ...
One concrete suggestion: create a test script that simply attempts to execute importlib.import_module(mod_name) before and after creating a ...
Read more >PyQt5 vs PySide2: What's the difference between the two ...
The key difference in the two versions — in fact the entire reason PySide2 exists — is licensing. PyQt5 is available under a...
Read more >PyQt5 Tutorial with Examples: Design GUI using PyQt in Python
This tutorial covers basic to advanced stuff like PyQt definitions, features, versions, installation guide, components and widgets, themes, ...
Read more >Modules and Imports - Python Module of the Week - PyMOTW
sys.modules is a dictionary mapping the names of imported modules to the module object ... package_dir_b) # Reload the module to get the...
Read more >PyQt5 tutorial 2022: Create a GUI with Python and Qt
PyQt is a library that lets you use the Qt GUI framework from Python. Qt itself is written in C++. By using it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You mean optional in a way such that qtpy library users can decide if they want to enable it, like:
Will be happy to!
Lack of response