diff --git a/CHANGELOG.md b/CHANGELOG.md index 407f25d..a1b7c8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.1.8 (pre-release) +- Fixed `No Qt platform plugin could be initialized` error, mentioned in #59 by @sunrainxyz + # 1.1.7 - Added MPS GPU acceleration support for Silicon Mac, mentioned in https://github.com/denizsafak/abogen/issues/32#issuecomment-3155902040 by @jefro108. **Please read the [Mac](https://github.com/denizsafak/abogen?tab=readme-ov-file#mac) section in the documentation again, as it requires additional configuration.** - Added word-by-word karaoke highlighting feature by @robmckinnon in PR #65 diff --git a/abogen/main.py b/abogen/main.py index 79ac6fb..6eda83b 100644 --- a/abogen/main.py +++ b/abogen/main.py @@ -4,6 +4,20 @@ import sys import platform import atexit import signal + +# Qt platform plugin detection (fixes #59) +try: + from PyQt5.QtCore import QLibraryInfo + plugins = QLibraryInfo.location(QLibraryInfo.PluginsPath) + platform_dir = os.path.join(plugins, "platforms") + if os.path.isdir(platform_dir): + os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = platform_dir + print("QT_QPA_PLATFORM_PLUGIN_PATH set to:", platform_dir) + else: + print("PyQt5 platform plugins not found at", platform_dir) +except ImportError: + print("PyQt5 not installed.") + from PyQt5.QtWidgets import QApplication from PyQt5.QtGui import QIcon from PyQt5.QtCore import qInstallMessageHandler, QtMsgType